Hi,
I would like to use API functions of adl_pwrdwn.h library to allow SLEEP mode with GSM stack turn-on to save some power in my application.
I have made a very simple openAT which subscribe to service and then call the pwrdwnAllowed API. There is also a timer every 1 minute to check the exit of the sleep mode, which as stated in documentation, cause the sleep exit
#include "adl_global.h"
#include "adl_pwrdwn.h"
adl_tmr_t *AppInit_Timer;
s32 PwrDwn_Handler;
// callback of cyclic timer
void AppInitFunc (u8 TimerId)
{
adl_rtcTime_t Time;
adl_rtcTimeStamp_t Stamp;
ascii buff[20];
adl_rtcGetTime(&Time);
adl_rtcConvertTime(&Time, &Stamp, ADL_RTC_CONVERT_TO_TIMESTAMP);
wm_sprintf(buff, "TimerAPP:%ld\r", Stamp.TimeStamp);
adl_atSendResponse(ADL_AT_RSP, buff);
}
// Callback for 32Khz mode entrance
void CB_SleepEntrance ( void )
{
adl_atSendResponse(ADL_AT_RSP, "Sleep entrace\r");
}
// Callback for 32Khz mode exit
void CB_SleepExit ( void )
{
adl_atSendResponse(ADL_AT_RSP, "Sleep exit\r");
}
// Start function
void Start(void)
{
adl_atSendResponse(ADL_AT_RSP, "START\r");
PwrDwn_Handler = adl_pwrdwnSubscribe(CB_SleepEntrance, CB_SleepExit);
if (PwrDwn_Handler > 0)
{
s32 ret;
ret = adl_pwrdwnAllowed(PwrDwn_Handler);
if (ret == OK)
adl_atSendResponse(ADL_AT_RSP, "OK power down\r");
else
adl_atSendResponse(ADL_AT_RSP, "Error allow power down\r");
}
else
adl_atSendResponse(ADL_AT_RSP, "Error power down\r");
// Set up 1 minute cyclic timer
AppInit_Timer = adl_tmrSubscribe (TRUE,600,ADL_TMR_TYPE_100MS,(adl_tmrHandler_t)AppInitFunc );
}
However, I never see the entrance of sleep.
If I give at+w32k command, then I get the entrace of sleep but the module reset (maybe it is not allowed when prwdwn service is enabled)
Anyone has use the adl_pwrdwn library or is there any sample?
That’s my current configuration:
“DWL”,“V08b13”,"",“Sierra Wireless”,55344,“111611 18:03”,“dda36757”,“00010000”
“FW”,“FW_SRC_747_8_F4_3.Q2687G”,“R7.47.4.201208311102.Q26CL702”,“Sierra Wireless”,2221264,“083112 11:02”,“6aa633a2”,“00020000”
“OAT”,“01.00.20140731120828”,“Mobi.Nyx”,“Contrive srl”,75944,“073114 12:08”,“1a19cfa4”,“00260000”
-“Developer Studio”,“2.3.2.201310241753”
-“Open AT Application Framework package”,“2.37.4.201209061149”
-“Open AT OS Package”,“6.37.0.201202060950”
-“Firmware Package”,“7.47.4.201208311102”
-“ExtendedATApplication Library Package”,“1.11.0.201209041207”
-“Internet Library Package”,“5.43.1.201206250935”
“ROM”,“800000”
“RAM”,“200000”
“DWLNAME”,“Q26CL702”
Thank you.
Best Regards,
Davide