Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device free bug fix pre release 3.5.7 #118

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions ezlopi-core/ezlopi-core-devices/ezlopi_core_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ l_ezlopi_device_t* ezlopi_device_add_device(cJSON* cj_device, const char* last_n
}

TRACE_D("Device Id (after): %08x", new_device->cloud_properties.device_id);
TRACE_S("")


if (NULL == l_device_head)
{
Expand Down Expand Up @@ -219,7 +217,7 @@ static void ezlopi_device_free_parent_tree(l_ezlopi_device_t* parent_device, uin
}

void ezlopi_device_free_device(l_ezlopi_device_t* device)
{
{
if (device && l_device_head)
{
if ((NULL != device->next) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,5 @@ EZLOPI_DEVICE_LIST("sensor-hilink-presence-sensor ", 67, sensor_0067_hilin
EZLOPI_DEVICE_LIST("sensor-ENS160-gas-sensor ", 68, sensor_0068_ENS160_gas_sensor)
EZLOPI_DEVICE_LIST("sensor-ze08-ch02-gas-sensor ", 69, sensor_0069_ze08_ch02_gas_sensor)

#warning "need to uncomment necessary modules";
//////// End of sensor/device list
EZLOPI_DEVICE_LIST(NULL, 0, NULL)
1 change: 0 additions & 1 deletion ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ static void ezlopi_initialize_devices_v3(void)
{

TRACE_S("Device_id_curr_device : [0x%x] ", curr_device->cloud_properties.device_id);
TRACE_E("Here");
l_ezlopi_item_t* curr_item = curr_device->items;
while (curr_item)
{
Expand Down
16 changes: 8 additions & 8 deletions ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,27 +177,27 @@ extern "C"
\"val_ip\": false,\
\"val_op\": false\
},\
{\
\"dev_type\": 7,\
\"dev_name\": \"temp_humi\",\
\"id_room\": \"\",\
\"id_item\": 16,\
\"gpio\": 18\
},\
{\
\"dev_type\": 1,\
\"dev_name\": \"for_test\",\
\"id_room\": \"\",\
\"id_item\": 2,\
\"gpio_in\": 0,\
\"gpio_out\": 15,\
\"gpio_out\": 32,\
\"pullup_ip\": false,\
\"pullup_op\": false,\
\"is_ip\": false,\
\"ip_inv\": false,\
\"op_inv\": false,\
\"val_ip\": false,\
\"val_op\": false\
},\
{\
\"dev_type\": 7,\
\"dev_name\": \"temp_humi\",\
\"id_room\": \"\",\
\"id_item\": 16,\
\"gpio\": 18\
}\
], \
\"dev_total\": 3}";
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion ezlopi-core/ezlopi-core-sntp/ezlopi_core_sntp.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void EZPI_CORE_sntp_get_local_time(char* time_buf, uint32_t buf_len)
if (setenv("TZ", posix_str, 1) != 0)
{
TRACE_E("Error setting time zone: %s", posix_str);
return NULL;
return ;
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ static int __init(l_ezlopi_item_t* item)
int ret = 0;
if (item)
{
if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num) &&
if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_out.gpio_num) &&
(255 != item->interface.gpio.gpio_out.gpio_num))
{
const gpio_config_t io_conf = {
Expand Down Expand Up @@ -525,7 +525,7 @@ static int __set_value(l_ezlopi_item_t* item, void* arg)

if (255 != item->interface.gpio.gpio_out.gpio_num)
{
if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num))
if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_out.gpio_num))
{
__set_gpio_value(item, value);
ezlopi_device_value_updated_from_device_broadcast(item);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static int __init(l_ezlopi_item_t* item)
int ret = 0;
if (item)
{
if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num) &&
if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_out.gpio_num) &&
(255 != item->interface.gpio.gpio_out.gpio_num))
{
const gpio_config_t io_conf = {
Expand All @@ -154,7 +154,6 @@ static int __init(l_ezlopi_item_t* item)
: GPIO_PULLDOWN_DISABLE,
.intr_type = GPIO_INTR_DISABLE,
};

if (0 == gpio_config(&io_conf))
{
// digital_io_write_gpio_value(item);
Expand Down Expand Up @@ -265,7 +264,7 @@ static int __set_value(l_ezlopi_item_t* item, void* arg)

if (255 != item->interface.gpio.gpio_out.gpio_num)
{
if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num))
if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_out.gpio_num))
{
__set_gpio_value(item, value);
ezlopi_device_value_updated_from_device_broadcast(item);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ static int __init(l_ezlopi_item_t* item)
if (item)
{

if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num) &&
if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_out.gpio_num) &&
(255 != item->interface.gpio.gpio_out.gpio_num))
{
const gpio_config_t io_conf = {
Expand Down Expand Up @@ -268,7 +268,7 @@ static int __set_value(l_ezlopi_item_t* item, void* arg)

if (255 != item->interface.gpio.gpio_out.gpio_num)
{
if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num))
if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_out.gpio_num))
{
__set_gpio_value(item, value);
ezlopi_device_value_updated_from_device_broadcast(item);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ static int __set_cjson_value(l_ezlopi_item_t* item, void* arg)
TRACE_I("item_id: %d", item->cloud_properties.item_id);
TRACE_I("cur value: %d", value);

if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.pwm.gpio_num))
if (GPIO_IS_VALID_GPIO(item->interface.pwm.gpio_num))
{
int target_value = (int)(((value * 17) / 100) + 13);
TRACE_I("target value: %d", target_value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static int __init(l_ezlopi_item_t* item)
s_ultrasonic_sensor_t* ultrasonic_HCSR04_sensor = (s_ultrasonic_sensor_t*)item->user_arg;
if (ultrasonic_HCSR04_sensor)
{
if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num))
if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_out.gpio_num))
{
const gpio_config_t io_conf = {
.pin_bit_mask = (1ULL << item->interface.gpio.gpio_out.gpio_num),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,32 +203,32 @@ static void __prepare_device_cloud_properties(l_ezlopi_device_t* device, cJSON*
device->cloud_properties.info = NULL;
device->cloud_properties.device_type_id = NULL;
}
static void __prepare_device_cloud_properties_ens160_parent_aqi(l_ezlopi_device_t* device, cJSON* cj_device)
{
char* device_name = NULL;
CJSON_GET_VALUE_STRING(cj_device, ezlopi_dev_name_str, device_name);
char device_full_name[50];
snprintf(device_full_name, 50, "%s_%s", device_name, "ENS160 AQI");
ASSIGN_DEVICE_NAME_V2(device, device_full_name);
}
// static void __prepare_device_cloud_properties_ens160_parent_aqi(l_ezlopi_device_t* device, cJSON* cj_device)
// {
// char* device_name = NULL;
// CJSON_GET_VALUE_STRING(cj_device, ezlopi_dev_name_str, device_name);
// char device_full_name[50];
// snprintf(device_full_name, 50, "%s_%s", device_name, "ENS160 AQI");
// ASSIGN_DEVICE_NAME_V2(device, device_full_name);
// }

static void __prepare_device_cloud_properties_ens160_child_voc(l_ezlopi_device_t* device, cJSON* cj_device)
{
char* device_name = NULL;
CJSON_GET_VALUE_STRING(cj_device, ezlopi_dev_name_str, device_name);
char device_full_name[50];
snprintf(device_full_name, 50, "%s_%s", device_name, "ENS160 VOC");
ASSIGN_DEVICE_NAME_V2(device, device_full_name);
}
// static void __prepare_device_cloud_properties_ens160_child_voc(l_ezlopi_device_t* device, cJSON* cj_device)
// {
// char* device_name = NULL;
// CJSON_GET_VALUE_STRING(cj_device, ezlopi_dev_name_str, device_name);
// char device_full_name[50];
// snprintf(device_full_name, 50, "%s_%s", device_name, "ENS160 VOC");
// ASSIGN_DEVICE_NAME_V2(device, device_full_name);
// }

static void __prepare_device_cloud_properties_ens160_child_co2(l_ezlopi_device_t* device, cJSON* cj_device)
{
char* device_name = NULL;
CJSON_GET_VALUE_STRING(cj_device, ezlopi_dev_name_str, device_name);
char device_full_name[50];
snprintf(device_full_name, 50, "%s_%s", device_name, "ENS160 C02");
ASSIGN_DEVICE_NAME_V2(device, device_full_name);
}
// static void __prepare_device_cloud_properties_ens160_child_co2(l_ezlopi_device_t* device, cJSON* cj_device)
// {
// char* device_name = NULL;
// CJSON_GET_VALUE_STRING(cj_device, ezlopi_dev_name_str, device_name);
// char device_full_name[50];
// snprintf(device_full_name, 50, "%s_%s", device_name, "ENS160 C02");
// ASSIGN_DEVICE_NAME_V2(device, device_full_name);
// }

static void __prepare_item_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_device, void* user_arg)
{
Expand Down