View Single Post
matristain's Avatar
Posts: 40 | Thanked: 14 times | Joined on Sep 2009 @ Monterrey Mexico
#950
Originally Posted by No!No!No!Yes! View Post
As quick suggestions ...
Avoid sleep 275
And in very-very-very-very metacode:
On widget startup (phone on ecc) $QBW_EXEC_REASON=="QBW_STARTUP_UPDATE", explicitly reset beecon timer parameters (delayIndex = 0 customIntervalSecs = 275) via DBUS method call set_param_uint32 see syntax in the wiki; after resetting both parms, issue a reset_rearm_timer method to the widget

On widget click $QBW_EXEC_REASON=="QBW_CLICK" , check if your very specific call active via usual dbus enquiries
If your specific call is not active (didn't dig how to check this) initiate call and explicitly set beecon timer parameters (delayIndex = 9 customIntervalSecs = 275) via DBUS method call set_param_uint32 see syntax in the wiki; after setting both parms, issue a reset_rearm_timer method to the widget
If your specific call is active (didn't dig how to check this) terminate call and reset widget timer as per QBW_STARTUP_UPDATE step

If execution of script is due to $QBW_EXEC_REASON=="QBW_TIMER_UPDATE" , check if specific call active via usual dbus enquiries
If your very specific call is active, drop call, and reinitiate call (275secs timer will still be in place)
If your very specific call is not active, reset timer as per previous steps

Issue specific exit status at the end of every condition if you want to draw different icons according to call status statuses

Hope this helps
How can i change the (delayIndex = 9 customIntervalSecs = 275) at runtime?

This is what I have (just first part)
PHP Code:
if [ "$QBW_EXEC_REASON== "QBW_CLICK" ]; then
    
if [ "$QBW_CURRENT_RESULTS_TEXT== "ON" ]; then
        
echo "OFF";
        exit 
0;
    else
        
#MAKE CALL
        #delayIndex = 9 customIntervalSecs = 275
        
echo "ON";
        exit 
1;
    
fi;  
fi