Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

AWS IoT SDK

ELA_2836231
Level 2
25 sign-ins 10 replies posted 10 sign-ins
Level 2

good afternoon

any ideas on why callback registered (successfully) with cy_wcm_register_event_callback() is never called when wifi disconnect from AP ?

i would be glad to get your experience on such issues.

many thanks

best regards

0 Likes
1 Solution
AditiB_81
Moderator
Moderator 250 replies posted 250 sign-ins 100 solutions authored
Moderator

In addition to my response, if you go through the API's description, cy_wcm_register_event_callback() registers an event callback to monitor the connection and IP address change events. This is an optional registration and use it if the application needs to monitor events across disconnection and reconnection. And if you go through the events that this function registers, they are -->

typedef enum
{
CY_WCM_EVENT_CONNECTING = 0, /**< STA connecting to an AP. */
CY_WCM_EVENT_CONNECTED, /**< STA connected to the AP. */
CY_WCM_EVENT_CONNECT_FAILED, /**< STA connection to the AP failed. */
CY_WCM_EVENT_RECONNECTED, /**< STA reconnected to the AP. */
CY_WCM_EVENT_DISCONNECTED, /**< STA disconnected from the AP. */
CY_WCM_EVENT_IP_CHANGED, /**< IP address change event. This event is notified after connection, re-connection, and IP address change due to DHCP renewal. */
} cy_wcm_event_t;

So, there is an event CY_WCM_EVENT_DISCONNECTED which WHD will report to WCM. In that case, an event callback will be registered with this function - cy_wcm_register_event_callback() and the arguement this function takes is "event_callback" which is the callback function to be invoked for the event. So, have you provided any event_callback function in your application?

Thanks

Aditi

View solution in original post

0 Likes
5 Replies
DheerajPK_41
Moderator
Moderator 750 replies posted 500 likes received 500 replies posted
Moderator

Hi,

The community had been experienced some problem(certain threads not published immediately) due to migration, sorry for the convenience.

Thanks,

-Dheeraj

0 Likes
ELA_2836231
Level 2
25 sign-ins 10 replies posted 10 sign-ins
Level 2

hi,

thanks @DheerajPK_41 

does it means there will be an update ?

thanks

0 Likes
AditiB_81
Moderator
Moderator 250 replies posted 250 sign-ins 100 solutions authored
Moderator

Hi,

Apologies for the late response. We are trying are best to resolve the issues in the community. Thank you for your patience. With regards to your query, can you explain in more detail? Is it that you're trying to have a callback at the time of disconnection and it isn't getting called?

Thanks

Aditi

0 Likes
AditiB_81
Moderator
Moderator 250 replies posted 250 sign-ins 100 solutions authored
Moderator

In addition to my response, if you go through the API's description, cy_wcm_register_event_callback() registers an event callback to monitor the connection and IP address change events. This is an optional registration and use it if the application needs to monitor events across disconnection and reconnection. And if you go through the events that this function registers, they are -->

typedef enum
{
CY_WCM_EVENT_CONNECTING = 0, /**< STA connecting to an AP. */
CY_WCM_EVENT_CONNECTED, /**< STA connected to the AP. */
CY_WCM_EVENT_CONNECT_FAILED, /**< STA connection to the AP failed. */
CY_WCM_EVENT_RECONNECTED, /**< STA reconnected to the AP. */
CY_WCM_EVENT_DISCONNECTED, /**< STA disconnected from the AP. */
CY_WCM_EVENT_IP_CHANGED, /**< IP address change event. This event is notified after connection, re-connection, and IP address change due to DHCP renewal. */
} cy_wcm_event_t;

So, there is an event CY_WCM_EVENT_DISCONNECTED which WHD will report to WCM. In that case, an event callback will be registered with this function - cy_wcm_register_event_callback() and the arguement this function takes is "event_callback" which is the callback function to be invoked for the event. So, have you provided any event_callback function in your application?

Thanks

Aditi

0 Likes
AditiB_81
Moderator
Moderator 250 replies posted 250 sign-ins 100 solutions authored
Moderator

Hi,

I hope my response is clear. So, have you provided any event_callback function in your application?

Thanks

0 Likes