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

Development #109

Merged
merged 120 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
eed5edf
added resetHub and enum & token scene_value_types
ezlo-rikenm Feb 22, 2024
fbb1820
added sendhttp
ezlo-rikenm Feb 22, 2024
906513f
debug sensor_devices gpio_str
ezlo-rikenm Feb 23, 2024
c79dce0
added isDictionaryChaged
ezlo-rikenm Feb 23, 2024
e783593
added isFirmwareUpdateState
ezlo-rikenm Feb 23, 2024
0560f11
added hasAtleastOneDictionaryValue
ezlo-rikenm Feb 23, 2024
a397d19
added ComparatorValues
ezlo-rikenm Feb 23, 2024
cf89296
added inArray, stringOperation & compare_Strings
ezlo-rikenm Feb 23, 2024
e20c1f0
added compareNumberRange
ezlo-rikenm Feb 23, 2024
3a941dd
added cloudState, isSceneState, isdeviceState , isDateRange , isOnce …
ezlo-rikenm Feb 23, 2024
a371a27
testing scenes
ezlo-rikenm Feb 26, 2024
7252bd4
testing compare_num
ezlo-rikenm Feb 26, 2024
6f6ce3d
merged with EZPI-315
ezlo-rikenm Feb 27, 2024
1ba8f80
testing after sencond merge
ezlo-rikenm Feb 27, 2024
fe0898a
wss-fix: wss-client to broadcast link-list
KrrishnaShah Feb 28, 2024
da4f2f5
Implemented scene state change
NDJ-EZLO Feb 28, 2024
7f69e57
testing isDate,isOnce,isDate_range and isSunState
ezlo-rikenm Feb 28, 2024
4cb1489
merged and tested isdate, issunstate and sendhttp
ezlo-rikenm Feb 28, 2024
c7767ce
debug SceneState mismatch
ezlo-rikenm Feb 29, 2024
ede86b0
added gpio_naming
ezlo-rikenm Feb 29, 2024
11ae696
added set_Device_armed
ezlo-rikenm Mar 1, 2024
3cfd473
merged development_release
ezlo-rikenm Mar 1, 2024
49752b5
testing comapare_value,compare_number_range, compare_string 7 inArray
ezlo-rikenm Mar 5, 2024
f620ab6
testing comapare_value,compare_number_range, compare_string 7 inArray
ezlo-rikenm Mar 5, 2024
f3ac640
testing comapare_value,compare_number_range, compare_string & inArray
ezlo-rikenm Mar 5, 2024
c686b05
fixed some bugs in cmakelist
NDJ-EZLO Mar 5, 2024
381f99f
Added test device configuration in kconfig
NDJ-EZLO Mar 6, 2024
82c3965
Edit scene issue solved. web server and uart rx service task stack si…
NDJ-EZLO Mar 7, 2024
e79f4b1
soil moisture sensor data issue fixed
NDJ-EZLO Mar 7, 2024
ec1b54a
Merge pull request #88 from ezloteam/sceneStateChange
lomasSE89 Mar 7, 2024
9f3236e
Merge branch 'development' into meshbot_edit_EZPI-324
lomasSE89 Mar 7, 2024
7a49e3b
Merge pull request #87 from ezloteam/meshbot_edit_EZPI-324
lomasSE89 Mar 7, 2024
722f496
Optional BLE enable
NDJ-EZLO Mar 7, 2024
c88b930
modified changed CJSON_GET_VALUE_INT to CJSON_GET_VALUE_DOUBLE
KrrishnaShah Mar 13, 2024
43de888
checking ezlopi_core_devices
ezlo-rikenm Mar 13, 2024
761d297
bug fixed
ezlo-rikenm Mar 15, 2024
23b7c9e
<1>bug fixed after removing 'device_to_free->next=null'; <2> note: '…
ezlo-rikenm Mar 15, 2024
b266690
adding proto-thread in all sub-thread
KrrishnaShah Mar 15, 2024
a75e511
Merge pull request #89 from ezloteam/sensor_device_init_bug_fix
lomasSE89 Mar 18, 2024
18d0356
working on adding thread (ptthread) as sub-routine in scene
KrrishnaShah Mar 18, 2024
54bcac3
refactored parent_tree clearing
ezlo-rikenm Mar 19, 2024
da1f45e
refactoring complete: scene uses proto-thread as co-routine for proce…
KrrishnaShah Mar 19, 2024
b183517
fixed item->user_arg dependencies
ezlo-rikenm Mar 20, 2024
e1fa4aa
fixed item->user_arg dependencies
ezlo-rikenm Mar 20, 2024
c6b56bd
merged development branch, txt field replaced with static const, mino…
KrrishnaShah Mar 20, 2024
ff256fd
added, ret = -1 in all sensor_modules ; for testing
ezlo-rikenm Mar 20, 2024
15c9745
found a bug when clearing 'item->user_arg' for child_node
ezlo-rikenm Mar 20, 2024
9af6089
Merge pull request #90 from ezloteam/hotfix_heap_fragmentation
lomasSE89 Mar 21, 2024
7f982b6
found bug in joystick_device in init phase
ezlo-rikenm Mar 21, 2024
9b5c20d
fixed joystick 'item->user_arg' issue
ezlo-rikenm Mar 21, 2024
a34030e
tested and working successfully
ezlo-rikenm Mar 21, 2024
2d29792
optimizing malloc, optimizing value formatter
KrrishnaShah Mar 21, 2024
9ebf83d
fixed crashing issue
KrrishnaShah Mar 22, 2024
dfcbacb
memory optimization in ble-prov
KrrishnaShah Mar 22, 2024
5b0efd4
substituting broadcast-str to broadcast-cjson, added broadcast-lock a…
KrrishnaShah Mar 25, 2024
41e6504
sensor testing remaining
ezlo-rikenm Mar 25, 2024
4e80c9d
tested all sensor_devices successfully
ezlo-rikenm Mar 26, 2024
6aebdbd
completed task EZPI-333 : https://jira.mios.com/browse/EZPI-333
ezlo-rikenm Mar 26, 2024
a66216e
Merge pull request #92 from ezloteam/development_merge_add_parent_id
lomasSE89 Mar 26, 2024
aba10ef
heap,code optimization
KrrishnaShah Mar 26, 2024
0a3edf3
implementation of https://jira.mios.com/browse/EZPI-341
lomassubedi Mar 26, 2024
3f0baa2
refactored parent_child_device naming , also added 'is_user_arg_uniqu…
ezlo-rikenm Mar 27, 2024
58e2a00
Merge pull request #94 from ezloteam/development_refactoring_module_n…
lomasSE89 Mar 28, 2024
07495ca
Merge pull request #95 from ezloteam/fake_login_EZPI-341
lomasSE89 Mar 28, 2024
7b04624
NVS ready.
lomassubedi Mar 29, 2024
98b226d
completed use of static buffer
KrrishnaShah Apr 1, 2024
0a57e5b
timing fix for web-socket-server api handling, some minor fixes
KrrishnaShah Apr 1, 2024
23433ff
Added uart params change feature and updated device info response
NDJ-EZLO Apr 1, 2024
e5454c5
Device status BLE characteristics added
NDJ-EZLO Apr 2, 2024
4e5903b
Modified device from string to boolean based
NDJ-EZLO Apr 2, 2024
551e894
Added wifi mac and ble mac in device infor command
NDJ-EZLO Apr 2, 2024
f05e42f
merged with development.
lomasSE89 Apr 2, 2024
30cd939
Merge pull request #96 from ezloteam/hotfix_heap_fragmentation_v3
lomasSE89 Apr 2, 2024
0c801ee
Merge branch 'dev_v3' into dev_v3_device_optimization
lomasSE89 Apr 2, 2024
c533ca1
some tweaks.
lomasSE89 Apr 2, 2024
ea7cafc
Initial implementation of status LED in esp32s3
NDJ-EZLO Apr 3, 2024
abeda40
Revert "Added wifi mac and ble mac in device infor command"
NDJ-EZLO Apr 3, 2024
124beb3
Uart issue resolve
NDJ-EZLO Apr 3, 2024
c093237
Merge pull request #97 from ezloteam/baud_rate_config_EZPI-347
lomasSE89 Apr 3, 2024
f931a45
Implemented indicator logic for addressable RGB and on/off led
NDJ-EZLO Apr 3, 2024
75e9813
Uart info command issue for new device serial parameters solved
NDJ-EZLO Apr 3, 2024
70f1e0c
implemented https://jira.mios.com/browse/EZPI-356
lomasSE89 Apr 3, 2024
582907b
Edited names
NDJ-EZLO Apr 3, 2024
f68366f
Merge pull request #99 from ezloteam/mDNS_Modification_EZPI-356
lomasSE89 Apr 4, 2024
f796624
Merge pull request #100 from ezloteam/baud_rate_config_EZPI-347
lomasSE89 Apr 4, 2024
c0ec5fe
update .gitignore.
lomasSE89 Apr 4, 2024
cbed73e
Adding ble mac service
NDJ-EZLO Apr 4, 2024
5e99e02
Merge branch 'development' into EZPI344-ble-service-addition
NDJ-EZLO Apr 4, 2024
ad2984f
Indicator LED tested
NDJ-EZLO Apr 4, 2024
5fa7c9e
Deleted heartbead led function
NDJ-EZLO Apr 4, 2024
985a0b9
Merge pull request #98 from ezloteam/EZPI344-ble-service-addition
lomasSE89 Apr 4, 2024
adf2523
ESP32 indicator led dimmable
NDJ-EZLO Apr 4, 2024
97d077b
finalized serial config https://jira.mios.com/browse/EZPI-347
lomasSE89 Apr 4, 2024
0e662dd
Merge pull request #101 from ezloteam/led_on_off_blinker
lomasSE89 Apr 4, 2024
f0d201e
added not_method
ezlo-rikenm Apr 4, 2024
e38e15c
Merge pull request #102 from ezloteam/wrap_up_api_for_initiative
lomasSE89 Apr 4, 2024
c648699
Merge branch 'development' into development_testing_device_tree_and_s…
lomasSE89 Apr 5, 2024
196200c
Merge pull request #103 from ezloteam/development_testing_device_tree…
lomasSE89 Apr 5, 2024
b78d5e5
added fix for setSceneState
ezlo-rikenm Apr 5, 2024
9f56f40
made change on names and added ble chars.
lomasSE89 Apr 5, 2024
922ce14
Merge pull request #104 from ezloteam/development_fixed_setSceneState
lomasSE89 Apr 5, 2024
9d7c39b
configured for esp32s3
KrrishnaShah Apr 4, 2024
8d1bfc5
merged development
KrrishnaShah Apr 5, 2024
9dc3198
testing dev
KrrishnaShah Apr 5, 2024
84df2ea
several changes on baud rate change.
lomasSE89 Apr 6, 2024
a0b7b73
bug fixed for EZPI-358. https://jira.mios.com/browse/EZPI-358
ezlo-rikenm Apr 8, 2024
05321e2
Merge pull request #105 from ezloteam/development_fix_scene_get_statu…
lomasSE89 Apr 8, 2024
b0f9465
adding guard to scene_create
ezlo-rikenm Apr 10, 2024
d880d92
added a guard for hub.scene.create
ezlo-rikenm Apr 10, 2024
cf60dea
Merge pull request #106 from ezloteam/development_new_scene_30kb_guard
lomasSE89 Apr 10, 2024
fe486b5
removed redundant on BLE.
lomasSE89 Apr 10, 2024
140ad4f
Merge branch 'development' into wrap_up_api_for_initiative
lomasSE89 Apr 10, 2024
f4a9008
Merge pull request #107 from ezloteam/wrap_up_api_for_initiative
lomasSE89 Apr 10, 2024
0fc8571
Complete https://jira.mios.com/browse/EZPI-365
lomasSE89 Apr 11, 2024
70d9206
added provisioning status for new BLE chars and Serial message.
lomasSE89 Apr 11, 2024
9254e59
Fix https://jira.mios.com/browse/EZPI-353
lomasSE89 Apr 11, 2024
f461048
wrap up.
lomasSE89 Apr 11, 2024
ac5e6bf
Merge pull request #108 from ezloteam/pre_release_v3.4.7
lomasSE89 Apr 11, 2024
5bf7604
update versions.
lomasSE89 Apr 11, 2024
4852345
changed Readme
lomasSE89 Apr 11, 2024
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: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.bin
firmware/**
firmware/v*/**
firmware/releaseNote.txt
Expand Down Expand Up @@ -70,4 +71,5 @@ _deps


dependencies.lock
sdkconfig.old
sdkconfig.old
sdkconfig
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ Navigate to your terminal or bash shell and execute the following commands:

```bash
git clone --recursive git@github.com:ezloteam/Ezlo_Pi.git ezlopi
cd ezlopi/firmware/ezlopi
cd Ezlo_Pi
```
### 2. Configure the Projec
You need to configure the project as per the chip type you are using. It needs to be modified the file ```sdkconfig``` , equivalent to making changes with ```idf.py menuconfig```.
EzloPi needs to have constant set of configurations which are defined for different variants of chips and saved in the file such that ```sdkconfig.<chip type>.<flash size>```. Copy the content of the chip you are using and paste it into ```sdkconfig```. For example if I want to build and run this firmware on ESP32C3 with 4MB of memory, I need to copy content of [sdkconfig.esp32c3.4mb](sdkconfig.esp32c3.4mb) into ```sdkconfig``` or rename the file ```sdkconfig.esp32c3.4mb``` to ```sdkconfig```, and then build as mentioned at #2. The list of pre-defined ```sdkconfig``` for different variants of ESP32 are listed as :

You need to configure the project as per the chip type you are using. It needs to be renamed the file ```sdkconfig.<chip type>.<flash size>``` to ```sdkconfig``` and then build the project with IDF command.
* __[ESP32 4MB Standard](sdkconfig.esp32.4mb)__
* __[ESP32-S3 4MB ](sdkconfig.esp32s3.4mb)__
* __[ESP32-S3 8MB](sdkconfig.esp32s3.8mb)__
Expand Down
66 changes: 58 additions & 8 deletions ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ const char* ezlopi_firmware_version_str = "firmware_version";
const char* ezlopi_uptime_str = "uptime";
const char* ezlopi_mac_str = "mac";
const char* ezlopi_uuid_str = "uuid";
const char* ezlopi_cloud_uuid_str = "cloud_uuid";
const char* ezlopi_config_version_str = "config_version";
const char* ezlopi_firmware_type_str = "firmware_type";
const char* ezlopi_deviceTypeId_str = "deviceTypeId";
const char* ezlopi_parentDeviceId_str = "parentDeviceId";
Expand Down Expand Up @@ -161,9 +163,11 @@ const char* ezlopi_internet_status_str = "internet_status";
const char* ezlopi_build_date_str = "build_date";
const char* ezlopi_unknown_str = "unknown";
const char* ezlopi_manufacturer_name_str = "manufacturer_name";
const char* ezlopi_build_str = "build";
const char* ezlopi_firmware_build_str = "firmware_build";
const char* ezlopi_chip_str = "chip";
const char* ezlopi_provisioned_status_str = "provisioned_status";
const char* ezlopi_provisioned_str = "provisioned";
const char* ezlopi_model_number_str = "model_number";
const char* ezlopi_serial_str = "serial";
const char* ezlopi_uuid_provisioning_str = "uuid_provisioning";
Expand All @@ -172,6 +176,7 @@ const char* ezlopi_cloud_server_str = "cloud_server";
const char* ezlopi_provision_token_str = "provision_token";
const char* ezlopi_device_type_ezlopi_str = "device_type_ezlopi";
const char* ezlopi_ssl_private_key_str = "ssl_private_key";
const char* ezlopi_ssl_public_key_str = "ssl_public_key";
const char* ezlopi_ssl_shared_key_str = "ssl_shared_key";
const char* ezlopi_signing_ca_certificate_str = "signing_ca_certificate";
const char* ezlopi_len_str = "len";
Expand All @@ -186,10 +191,8 @@ const char* ezlopi_config_id_str = "config_id";
const char* ezlopi_config_time_str = "config_time";
const char* ezlopi_ssid_str = "ssid";
const char* ezlopi_dev_type_ezlopi_str = "dev_type_ezlopi";
const char* ezlopi_dev_flash_str = "dev_flash";
const char* ezlopi_flash_size_str = "flash_size";
const char* ezlopi_dev_free_flash_str = "dev_free_flash";
const char* ezlopi_manf_name_str = "manf_name";
const char* ezlopi_model_num_str = "model_num";
const char* ezlopi_sta_connection_str = "sta_connection";
const char* ezlopi_ip_sta_str = "ip_sta";
const char* ezlopi_ip_nmask_str = "ip_nmask";
Expand All @@ -201,13 +204,19 @@ const char* ezlopi_uuid_prov_str = "uuid_prov";
const char* ezlopi_status_write_str = "status_write";
const char* ezlopi_status_connect_str = "status_connect";
const char* ezlopi_first_start_str = "first_start";

const char* ezlopi_gpio1_str = "gpio1";
const char* ezlopi_gpio2_str = "gpio2";
const char* ezlopi_gpio3_str = "gpio3";
const char* ezlopi_gpio4_str = "gpio4";
const char* ezlopi_gpio5_str = "gpio5";
const char* ezlopi_gpio6_str = "gpio6";
const char* ezlopi_gpio7_str = "gpio7";
const char* ezlopi_gpio8_str = "gpio8";

const char* ezlopi_gpio_tx_str = "gpio_tx";
const char* ezlopi_gpio_rx_str = "gpio_rx";
const char* ezlopi_baud_str = "baud";
const char* ezlopi_baud_rate_str = "baud_rate";
const char* ezlopi_sceneId_str = "sceneId";
const char* ezlopi_changed_by_str = "changed_by";

Expand All @@ -217,14 +226,15 @@ const char* scene_status_partially_finished_str = "partially_finished";
const char* scene_status_failed_str = "failed";
const char* scene_status_stopped_str = "stopped";

const char* ezlopi_valueformatted_str = "valueFormatted";
const char* ezlopi_value_default_str = "valueDefault";
// const char* ezlopi_valueformatted_str = "valueFormatted";
const char* ezlopi_valueDefault_str = "valueDefault";
const char* ezlopi_text_str = "text";
const char* ezlopi_lang_tag_str = "lang_tag";
const char* ezlopi_description_str = "description";
const char* ezlopi_value_min_str = "valueMin";
const char* ezlopi_value_max_str = "valueMax";
const char* ezlopi_valueMin_str = "valueMin";
const char* ezlopi_valueMax_str = "valueMax";
const char* ezlopi_idle_str = "idle";
const char* ezlopi_is_active_str = "is_active";

const char* ezlopi_armed_str = "armed";
const char* ezlopi_subtype_str = "subtype";
Expand Down Expand Up @@ -269,4 +279,44 @@ const char* ezlopi_houseMode_str = "houseMode";

const char* ezlopi_client_id_str = "client_id";

const char* ezlopi_endValue_str = "endValue";
const char* ezlopi_startValue_str = "startValue";
const char* ezlopi_item_str = "item";
const char* ezlopi_comparator_str = "comparator";
const char* ezlopi_scenes_str = "scenes";

const char* ezlopi_logic_inv_str = "logic_inv";
const char* ezlopi_duty_cycle_str = "duty_cycle";
const char* ezlopi_freq_hz_str = "freq_hz";
const char* ezlopi_slave_addr_str = "slave_addr";
const char* ezlopi_pull_up_str = "pull_up";

const char* ezlopi_red_str = "red";
const char* ezlopi_green_str = "green";
const char* ezlopi_blue_str = "blue";
const char* ezlopi_cwhite_str = "cwhite";

const char* ezlopi_minValue_str = "minValue";
const char* ezlopi_maxValue_str = "maxValue";

const char* ezlopi_confidence_level_str = "confidence_level";
const char* ezlopi_elementType_str = "elementType";

const char* ezlopi_min_move_distance_str = "min_move_distance";
const char* ezlopi_max_move_distance_str = "max_move_distance";
const char* ezlopi_min_still_distance_str = "min_still_distance";
const char* ezlopi_max_still_distance_str = "max_still_distance";
const char* ezlopi_timeout_str = "timeout";

const char* ezlopi_latitude_str = "latitude";
const char* ezlopi_longitude_str = "longitude";

const char* ezlopi_urls_str = "urls";

const char* ezlopi_parity_str = "parity";
const char* ezlopi_start_bits_str = "start_bits";
const char* ezlopi_stop_bits_str = "stop_bits";
const char* ezlopi_frame_size_str = "frame_size";
const char* ezlopi_flow_control_str = "flow_control";

#endif // __EZLOPI_CLOUD_KEYWORDS_H__
67 changes: 59 additions & 8 deletions ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ extern const char* ezlopi_firmware_version_str;
extern const char* ezlopi_uptime_str;
extern const char* ezlopi_mac_str;
extern const char* ezlopi_uuid_str;
extern const char* ezlopi_cloud_uuid_str;
extern const char* ezlopi_config_version_str;
extern const char* ezlopi_firmware_type_str;
extern const char* ezlopi_deviceTypeId_str;
extern const char* ezlopi_parentDeviceId_str;
Expand Down Expand Up @@ -163,9 +165,11 @@ extern const char* ezlopi_internet_status_str;
extern const char* ezlopi_build_date_str;
extern const char* ezlopi_unknown_str;
extern const char* ezlopi_manufacturer_name_str;
extern const char* ezlopi_firmware_build_str;
extern const char* ezlopi_build_str;
const char* ezlopi_firmware_build_str;
extern const char* ezlopi_chip_str;
extern const char* ezlopi_provisioned_status_str;
const char* ezlopi_provisioned_str;
extern const char* ezlopi_model_number_str;
extern const char* ezlopi_serial_str;
extern const char* ezlopi_uuid_provisioning_str;
Expand All @@ -174,6 +178,7 @@ extern const char* ezlopi_cloud_server_str;
extern const char* ezlopi_provision_token_str;
extern const char* ezlopi_device_type_ezlopi_str;
extern const char* ezlopi_ssl_private_key_str;
extern const char* ezlopi_ssl_public_key_str;
extern const char* ezlopi_ssl_shared_key_str;
extern const char* ezlopi_signing_ca_certificate_str;
extern const char* ezlopi_len_str;
Expand All @@ -188,10 +193,8 @@ extern const char* ezlopi_config_id_str;
extern const char* ezlopi_config_time_str;
extern const char* ezlopi_ssid_str;
extern const char* ezlopi_dev_type_ezlopi_str;
extern const char* ezlopi_dev_flash_str;
extern const char* ezlopi_flash_size_str;
extern const char* ezlopi_dev_free_flash_str;
extern const char* ezlopi_manf_name_str;
extern const char* ezlopi_model_num_str;
extern const char* ezlopi_sta_connection_str;
extern const char* ezlopi_ip_sta_str;
extern const char* ezlopi_ip_nmask_str;
Expand All @@ -203,13 +206,19 @@ extern const char* ezlopi_uuid_prov_str;
extern const char* ezlopi_status_write_str;
extern const char* ezlopi_status_connect_str;
extern const char* ezlopi_first_start_str;

extern const char* ezlopi_gpio1_str;
extern const char* ezlopi_gpio2_str;
extern const char* ezlopi_gpio3_str;
extern const char* ezlopi_gpio4_str;
extern const char* ezlopi_gpio5_str;
extern const char* ezlopi_gpio6_str;
extern const char* ezlopi_gpio7_str;
extern const char* ezlopi_gpio8_str;

extern const char* ezlopi_gpio_tx_str;
extern const char* ezlopi_gpio_rx_str;
extern const char* ezlopi_baud_str;
extern const char* ezlopi_baud_rate_str;
extern const char* ezlopi_sceneId_str;
extern const char* ezlopi_changed_by_str;

Expand All @@ -221,16 +230,18 @@ extern const char* scene_status_stopped_str;
extern const char* ezlopi_armed_str;
extern const char* ezlopi_subtype_str;

extern const char* ezlopi_value_default_str;
extern const char* ezlopi_valueDefault_str;
extern const char* ezlopi_text_str;
extern const char* ezlopi_label_str;
extern const char* ezlopi_lang_tag_str;
extern const char* ezlopi_description_str;
extern const char* ezlopi_value_type_str;
extern const char* ezlopi_value_min_str;
extern const char* ezlopi_value_max_str;
extern const char* ezlopi_valueMin_str;
extern const char* ezlopi_valueMax_str;
extern const char* ezlopi_no_str;
extern const char* ezlopi_idle_str;
extern const char* ezlopi_is_active_str;

extern const char* ezlopi_location_str;
extern const char* ezlopi_locations_str;
extern const char* ezlopi_custom_timezone_str;
Expand Down Expand Up @@ -271,4 +282,44 @@ extern const char* ezlopi_houseMode_str;
extern const char* ezlopi_client_id_str;
extern const char* ezlopi_source_str;

extern const char* ezlopi_endValue_str;
extern const char* ezlopi_startValue_str;
extern const char* ezlopi_item_str;
extern const char* ezlopi_comparator_str;
extern const char* ezlopi_scenes_str;

extern const char* ezlopi_logic_inv_str;
extern const char* ezlopi_duty_cycle_str;
extern const char* ezlopi_freq_hz_str;
extern const char* ezlopi_slave_addr_str;
extern const char* ezlopi_pull_up_str;

extern const char* ezlopi_red_str;
extern const char* ezlopi_green_str;
extern const char* ezlopi_blue_str;
extern const char* ezlopi_cwhite_str;

extern const char* ezlopi_minValue_str;
extern const char* ezlopi_maxValue_str;

extern const char* ezlopi_confidence_level_str;
extern const char* ezlopi_elementType_str;

extern const char* ezlopi_min_move_distance_str;
extern const char* ezlopi_max_move_distance_str;
extern const char* ezlopi_min_still_distance_str;
extern const char* ezlopi_max_still_distance_str;
extern const char* ezlopi_timeout_str;

extern const char* ezlopi_latitude_str;
extern const char* ezlopi_longitude_str;

extern const char* ezlopi_urls_str;

const char* ezlopi_parity_str;
const char* ezlopi_start_bits_str;
const char* ezlopi_stop_bits_str;
const char* ezlopi_frame_size_str;
const char* ezlopi_flow_control_str;

#endif // __EZLOPI_CLOUD_KEYWORDS_H__
1 change: 1 addition & 0 deletions ezlopi-cloud/ezlopi-cloud-coordinates/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ idf_component_register(SRCS "ezlopi_cloud_coordinates.c"
REQUIRES json
ezlopi-util-trace
ezlopi-core-nvs
ezlopi-core-ezlopi
ezlopi-cloud-constants
)

39 changes: 20 additions & 19 deletions ezlopi-cloud/ezlopi-cloud-coordinates/ezlopi_cloud_coordinates.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,51 @@
#include "ezlopi_util_trace.h"

#include "ezlopi_core_nvs.h"
#include "ezlopi_core_cjson_macros.h"

#include "ezlopi_cloud_constants.h"
#include "ezlopi_cloud_coordinates.h"

static float latitude;
static float longitude;
static double sg_latitude;
static double sg_longitude;

void hub_coordinates_set(cJSON* cj_request, cJSON* cj_response)
{
cJSON_AddItemReferenceToObject(cj_response, ezlopi_id_str, cJSON_GetObjectItem(cj_request, ezlopi_id_str));
cJSON_AddItemReferenceToObject(cj_response, ezlopi_method_str, cJSON_GetObjectItem(cj_request, ezlopi_method_str));
cJSON_AddObjectToObject(cj_response, ezlopi_result_str);
if (cj_request)
{
cJSON* cj_params = cJSON_GetObjectItem(cj_request, ezlopi_params_str);
if (cj_params)
{
latitude = cJSON_GetObjectItem(cj_params, "latitude")->valuedouble;
longitude = cJSON_GetObjectItem(cj_params, "longitude")->valuedouble;
char* lat_long_str = cJSON_Print(cj_params);
cJSON_Minify(lat_long_str);
ezlopi_nvs_write_latitude_longitude(lat_long_str);
free(lat_long_str);
CJSON_GET_VALUE_DOUBLE(cj_params, ezlopi_latitude_str, sg_latitude);
CJSON_GET_VALUE_DOUBLE(cj_params, ezlopi_longitude_str, sg_longitude);

char lat_long_str[256];
if (cJSON_PrintPreallocated(cj_params, lat_long_str, sizeof(lat_long_str), false))
{
ezlopi_nvs_write_latitude_longitude(lat_long_str);
}
}
}
}

void hub_coordinates_get(cJSON* cj_request, cJSON* cj_response)
{
cJSON_AddItemReferenceToObject(cj_response, ezlopi_id_str, cJSON_GetObjectItem(cj_request, ezlopi_id_str));
cJSON_AddItemReferenceToObject(cj_response, ezlopi_method_str, cJSON_GetObjectItem(cj_request, ezlopi_method_str));
char* lat_long_vals = ezlopi_nvs_read_latidtude_longitude();
cJSON* cj_lat_long_val = cJSON_Parse(lat_long_vals);
cJSON_AddItemToObject(cj_response, ezlopi_result_str, cj_lat_long_val);
free(lat_long_vals);
if (lat_long_vals)
{
cJSON_AddRawToObject(cj_response, ezlopi_result_str, lat_long_vals);
free(lat_long_vals);
}
}

float ezlopi_cloud_get_latitude()
double ezlopi_cloud_get_latitude()
{
return latitude;
return sg_latitude;
}

float ezlopi_cloud_get_longitude()
double ezlopi_cloud_get_longitude()
{
return longitude;
return sg_longitude;
}

Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

#include "cJSON.h"

void hub_coordinates_set(cJSON *cjson_request, cJSON *cjson_response);
void hub_coordinates_set(cJSON* cjson_request, cJSON* cjson_response);
void hub_coordinates_get(cJSON* cj_request, cJSON* cj_response);
float ezlopi_cloud_get_longitude();
float ezlopi_cloud_get_latitude();
double ezlopi_cloud_get_longitude();
double ezlopi_cloud_get_latitude();

#endif // _EZLOPI_CLOUD_COORDINSTES_H_

6 changes: 2 additions & 4 deletions ezlopi-cloud/ezlopi-cloud-data/ezlopi_cloud_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
#include "ezlopi_cloud_methods_str.h"

void data_list(cJSON *cj_request, cJSON *cj_response)
{
cJSON_AddItemReferenceToObject(cj_response, ezlopi_id_str, cJSON_GetObjectItem(cj_request, ezlopi_id_str));
cJSON_AddItemReferenceToObject(cj_response, ezlopi_method_str, cJSON_GetObjectItem(cj_request, ezlopi_method_str));
cJSON *cjson_result = cJSON_AddObjectToObject(cj_response, ezlopi_result_str);
{
cJSON* cjson_result = cJSON_AddObjectToObject(cj_response, ezlopi_result_str);
if (cjson_result)
{
cJSON *cj_settings = cJSON_AddObjectToObject(cjson_result, ezlopi_settings_str);
Expand Down
Loading