Starting out with FCM services


#1

Hi everyone,
I’m still new to my WAVECOM Fastrack Supreme device and I was figuring out how the FCM services work. I seem to have a grasp of most of the stuff. However in my code I could not get the adl_fcmUnsubscribe() function to work correctly. I can usually tell if it properly unsubscribed from a FCM service because I have it output the event. However for some reason it never gets to that event. I’m I misunderstanding how this function works? Thanks in advance for any help you can provide.

#include "adl_global.h"

const u16 wm_apmCustomStackSize = 1024;

bool fcmCtrlH( adl_fcmEvent_e event);
bool fcmDataH( u16 DataLen, u8 *Data);

char buffer[10] = "Hello";    
s8 Handle,func;

void adl_main ( adl_InitType_e InitType )
{
    bool status;

    
    status = adl_fcmIsAvailable( ADL_FCM_FLOW_V24_UART1 );
    
    if(status)
        TRACE (( 1, "UART1 port available" )); 
    else
        TRACE (( 1, "UART1 port unavailable" ));
        
        
    Handle = adl_fcmSubscribe( ADL_FCM_FLOW_V24_UART1, fcmCtrlH, fcmDataH );
}
   
bool fcmCtrlH( adl_fcmEvent_e event)
{
         switch(event){
         
             case ADL_FCM_EVENT_FLOW_OPENNED:
                         TRACE (( 2, "ADL_FCM_EVENT_FLOW_OPENNED" ));
                         adl_fcmSwitchV24State(Handle,ADL_FCM_V24_STATE_DATA);
                     break;
                     
             case ADL_FCM_EVENT_V24_DATA_MODE:
                         TRACE ((3, "ADL_FCM_EVENT_V24_DATA_MODE" ));
                         if(adl_fcmSendData(Handle,buffer,10)==OK)
                         {
                            TRACE (( 4, "Message sent" ));
                            adl_fcmUnsubscribe( Handle );
                         }
                         else
                         {  
                            TRACE (( 4, "Message not sent" ));
                            adl_fcmUnsubscribe( Handle );
                         }
                            
                     break;
                
             case ADL_FCM_EVENT_FLOW_CLOSED:
                     TRACE (( 4, "ADL_FCM_EVENT_FLOW_CLOSED" ));
                     break;
         }
        return TRUE;
}

bool fcmDataH( u16 DataLen, u8 *Data)
{ 
    return TRUE;
}