-
Notifications
You must be signed in to change notification settings - Fork 2
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
Twin Implementation #18
base: main
Are you sure you want to change the base?
Conversation
iotconnect-sdk/include/iotconnect.h
Outdated
typedef struct { | ||
char *env; // Environment name. Contact your representative for details. | ||
char *cpid; // Settings -> Company Profile. | ||
char *duid; // Name of the device. | ||
IotclOtaCallback ota_cb; // callback for OTA events. | ||
IotclCommandCallback cmd_cb; // callback for command events. | ||
IotcltwinrecivCallback twin_msg_rciv; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the same naming conventions as the other callback be followed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in the above latest commit.
printk("Error: no mqtt data_cb configured\n"); | ||
printk("Error: no mqtt data_cb configured\n"); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be properly indented to avoid confusion of the double braces back to back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in the above latest commit.
samples/iotc-basic/src/main.c
Outdated
@@ -19,7 +19,7 @@ | |||
#include "led_pwm.h" | |||
#else | |||
#define ui_leds_init() | |||
#define ui_led_set_rgb(a,b,c) (void) (a,b,c) | |||
#define ui_led_set_rgb(a,b,c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are the void statements removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in the above latest commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#define ui_led_set_rgb(a,b,c) was left since i used it from releases https://github.com/avnet-iotconnect/iotc-nrf-sdk/releases/tag/v2.0.0 "v2.0.0".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please check the variable name casing some of the new ones start with capital etc.,
@sw-ms-imranbhadelia Could you please take up the review? |
[scripts/setup-iotc-c-lib.sh ]
git clone --depth 1 --branch iotc-c-lib-patch https://github.com/avnet-iotconnect/iotc-c-lib.git
added git clone repo along with change in branch as it has the wrong url as well
[**iotconnect_event.h ** ] Twin Update
Declare the twin callback and process the iotcl_process_twin_event().
[iotc-c-lib-patch](avnet-iotconnect/iotc-c-lib@55faa28)
[ iotconnect_event.c] Twin Update
Defined the twin callback and processed the iotcl_process_twin_event() for reporting the value.
[iotc-c-lib-patch](avnet-iotconnect/iotc-c-lib@55faa28)
[samples/iotc-sensors-gps/src/main.c & samples/iotc-basic/src/main.c ]
Added Twin update callback
config->twin_msg_cb = on_twin_command;
static void on_twin_command(IotclEventData payload)
[ otconnect-sdk/src/iotconnect.c]
Added Twin static topic requires update and report the twin value
at defined iotc_twin_mqtt_data() where SDK will receive the twin payload.
iotconnect_update_twin() method to report the updated value coming from firmware.
[ iotconnect-sdk/include/iotconnect.h]
Declare twin call back in IotconnectClientConfig structure.
[iotconnect-sdk/nrf-layer-lib/src/iotconnect_mqtt.c ]
Along with the event topic twin payload is going to be identified
[iotconnect-sdk/nrf-layer-lib/include/iotconnect_mqtt.h ]
Declare twin call back under IotconnectMqttConfig structure.
@imran Please take a look at the changes.