How to cancel a scheduled by PWRM_eScheduleActivity() event

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to cancel a scheduled by PWRM_eScheduleActivity() event

1,267 Views
Alkarax
Contributor II

Hi! I am developing a zigbee sleeping device using jn5169 MCU and JN-SW-4170 SDK. When the device loses its connection, it should go to sleep and wake up once a minute and try to reconnect, but if the button is pressed, it should also wake up and try to reconnect. I am using the PWRM_eScheduleActivity () function to sleep. How to cancel or restart an event scheduled by this function if the button was pressed and the reconnection was successful?

Labels (1)
Tags (2)
0 Kudos
5 Replies

1,184 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Alkarax,

Could you please confirm the AN that you are working on?

What is the value that you are getting in the variable u8WakeInt in the vISR_SystemController function?

What is the timer that you are working on?

Regards,

Mario

0 Kudos

1,215 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Alkarax,

I am sorry, I think that I am understanding your issue. 

Are you still getting the button event after the reconnection?

Regards,

Mario

0 Kudos

1,195 Views
Alkarax
Contributor II

Yes, I do.

Best regards

0 Kudos

1,256 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi @Alkarax,

Just to confirm, do you want to avoid entering into sleep mode after the reconnection?

You could call PWRM_eStartActivity to avoid entering into sleep mode and after that, you could call PWRM_eFinishActivity to allow entry into sleep.

Regards,

Mario

0 Kudos

1,249 Views
Alkarax
Contributor II

Hi, Mario! No, not like this. Imagine the situation: my device lost connection and enter into sleep for a minute, after 10 seconds I press a button, and it wakes up and reconnects successfully. Now I need to enter into sleep and wake up every 5 seconds (because I am online and send pull requests), but a minute from the beginning of the first sleep has not passed and the past event is still active, even though I no longer need it.

Best regards

0 Kudos