Exemplo n.º 1
0
// timer callback function
void Timer_handler(u32 timerId, void* param)
{
    *((s32*)param) +=1;
    if(Stack_timer == timerId)
    {
        APP_DEBUG("<-- stack Timer_handler, param:%d -->\r\n", *((s32*)param));
        // stack_timer repeat
        if(*((s32*)param) >= TIMEOUT_COUNT)
        {
            s32 ret;
            ret = Ql_Timer_Stop(Stack_timer);
            if(ret < 0)
            {
                APP_DEBUG("\r\n<--failed!! stack timer Ql_Timer_Stop ret=%d-->\r\n",ret);
            }
            APP_DEBUG("\r\n<--stack timer Ql_Timer_Stop(ID=%d,) ret=%d-->\r\n",Stack_timer,ret);
        }
    }
    if(GP_timer == timerId)
    {
        APP_DEBUG("<-- GP-Timer_handler, param:%d -->\r\n", *((s32*)param));
        //not repeat
    }

}
Exemplo n.º 2
0
static void * idigi_run_thread(void * arg)
{
    idigi_status_t status = idigi_success;

    APP_DEBUG("idigi_run thread starts\n");

    while (status == idigi_success)
    {
        status = idigi_run((idigi_handle_t)arg);

        if (status == idigi_receive_error ||
            status == idigi_send_error ||
            status == idigi_connect_error)
        {
            /* server may disconnect us, so
             * let's try to reconnect.
             */
            status = idigi_success;
        }
        /* if status is not idigi_success, calling idigi_run
         * again will cause to re-connect to idigi.
         */
    }
    APP_DEBUG("idigi_run thread exits %d\n", status);

    pthread_exit(arg);
}
Exemplo n.º 3
0
void proc_main_task(s32 taskId)
{
    ST_MSG msg;
    s32 ret;

    // Register & open UART port
    ret = Ql_UART_Register(UART_PORT1, CallBack_UART_Hdlr, NULL);
    Ql_UART_Register(UART_PORT2, CallBack_UART_Hdlr, NULL);
    Ql_UART_Register(UART_PORT3, CallBack_UART_Hdlr, NULL);
    ret = Ql_UART_Open(UART_PORT1, 115200, FC_NONE);
    Ql_UART_Open(UART_PORT2, 115200, FC_NONE);
    Ql_UART_Open(UART_PORT3, 115200, FC_NONE);
    APP_DEBUG("<--OpenCPU: system.-->\r\n");

    while(TRUE)
    {
        Ql_OS_GetMessage(&msg);
        switch(msg.message)
        {
#ifdef __OCPU_RIL_SUPPORT__
        case MSG_ID_RIL_READY:
            APP_DEBUG("<-- RIL is ready -->\r\n");
            Ql_RIL_Initialize();
            break;
#endif
        default:
            break;
        }
    }
}
Exemplo n.º 4
0
static void CallBack_UART_Hdlr(Enum_SerialPort port, Enum_UARTEventType msg, bool level, void* customizedPara)
{
    switch (msg)
    {
    case EVENT_UART_READY_TO_READ:
    {

        s32 totalBytes = ReadSerialPort(port, m_RxBuf_Uart, sizeof(m_RxBuf_Uart));
        if (totalBytes > 0)
        {
            proc_handle(m_RxBuf_Uart,sizeof(m_RxBuf_Uart));
        }
        break;
    }
    case EVENT_UART_DTR_IND:// DTR level changed, developer can wake up the module in here
    {
        if(0 == level)
        {
            APP_DEBUG("DTR set to low =%d  wake !!\r\n", level);
            Ql_SleepDisable();
        }
        else
        {
            APP_DEBUG("DTR set to high =%d  Sleep \r\n", level);
            Ql_SleepEnable();
        }

    }
    case EVENT_UART_READY_TO_WRITE:
        break;
    default:
        break;
    }
}
Exemplo n.º 5
0
static void InitializeSerialPort(void)
{
    s32 ret;

     // Register & open UART port
    // UART port
    ret = Ql_UART_Register(m_myUartPort, CallBack_UART_Hdlr, NULL);
    if (ret < QL_RET_OK)
    {
        Ql_Debug_Trace("Fail to register serial port[%d], ret=%d\r\n", m_myUartPort, ret);
    }
    ret = Ql_UART_Open(m_myUartPort, 115200, FC_NONE);
    if (ret < QL_RET_OK)
    {
        Ql_Debug_Trace("Fail to open serial port[%d], ret=%d\r\n", m_myUartPort, ret);
    }
     Ql_UART_Write(m_myUartPort, "\r\nRDY\r\n", Ql_strlen("\r\nRDY\r\n")); 

    // Register & open virtual serial port
    ret = Ql_UART_Register(m_myVirtualPort, CallBack_UART_Hdlr, NULL);
    if (ret < QL_RET_OK)
    {
        APP_DEBUG("Fail to register serial port[%d], ret=%d\r\n", m_myVirtualPort, ret);
    }
    ret = Ql_UART_Open(m_myVirtualPort, 115200, FC_NONE);
    if (ret < QL_RET_OK)
    {
        APP_DEBUG("Fail to open serial port[%d], ret=%d\r\n", m_myVirtualPort, ret);
    }

}
Exemplo n.º 6
0
void CSD_Disconnect(void)
{
    // -------- Received END command, exit from CSD data mode -------
    APP_DEBUG("<-- Exit from CSD data mode -->\r\n");
    Ql_UART_SendEscap(m_myVirtualPort);

    // -------- Close CSD connection -------
    APP_DEBUG("<-- Close CSD connection -->\r\n");
    Ql_UART_Write(m_myVirtualPort, "ATH\n", 4);
}
Exemplo n.º 7
0
void CallBack_GPRS_Deactived(u8 contextId, s32 errCode, void* customParam )
{
    if (errCode == SOC_SUCCESS)
    {
        APP_DEBUG("<--CallBack: deactived GPRS successfully.-->\r\n"); 
        m_tcp_state = STATE_NW_GET_SIMSTATE;
    }else
    {
        APP_DEBUG("<--CallBack: deactived GPRS failure,(contexid=%d,error_cause=%d)-->\r\n",contextId,errCode); 
    }
}
Exemplo n.º 8
0
void UserData_BackUp_callback(s8 result, u8* pUserData, s32 len)
{
    if(result)// 1 means backup successfully
    {
        APP_DEBUG("<--callback:Sysparam backUp successfully !!!-->\r\n");
    }
    else  // -1 means backup failed.
    {
        APP_DEBUG("<--callback:User Data backUP failed!!!-->\r\n");
    }
}
Exemplo n.º 9
0
void Callback_GPRS_Actived(u8 contexId, s32 errCode, void* customParam)
{
    if(errCode == SOC_SUCCESS)
    {
        APP_DEBUG("<--CallBack: active GPRS successfully.-->\r\n");
        m_tcp_state = STATE_GPRS_GET_DNSADDRESS;
    }else
    {
        APP_DEBUG("<--CallBack: active GPRS successfully,errCode=%d-->\r\n",errCode);
        m_tcp_state = STATE_GPRS_ACTIVATE;
    }      
}
Exemplo n.º 10
0
static void * application_run_thread(void * arg)
{
    int status;

    APP_DEBUG("idigi_run thread starts\n");

    status = application_run((idigi_handle_t)arg);

    APP_DEBUG("application_run thread exits %d\n", status);

    pthread_exit(arg);
}
Exemplo n.º 11
0
static void Telephony_CallOut(void)
{
    s32 ret;
    s32 callState;
    char callOutPhoneNum[] = "15056083774\0";
    ret = RIL_Telephony_Dial(0, callOutPhoneNum, &callState);
    if (RIL_AT_SUCCESS == ret && CALL_STATE_OK == callState)
    {
        APP_DEBUG("<-- Dial \"%s\" successfully -->\r\n", callOutPhoneNum);
    } else {
        APP_DEBUG("<-- Fail to dial \"%s\", cause: %d -->\r\n", ret);
    }
}
Exemplo n.º 12
0
void UserData_Read_callback(s8 result, u8* pUserData, s32 len)
{
    ST_UARTDCB* pBackupData = (ST_UARTDCB* )pUserData;

    if(result)// 1 means backup successfully
    {

        APP_DEBUG("<--callback: Sysparam(len=%d) Read out successfully! BaudRate=%d,DataBit=%d,FlowCtrl=%d,Parity=%d,StopBit=%d-->\r\n", \
                  len,pBackupData->baudrate,pBackupData->dataBits,pBackupData->flowCtrl,pBackupData->parity,pBackupData->stopBits);
    }
    else  // -1 means backup failed.
    {
        APP_DEBUG("<--callback: User Data Read out failed!!!-->\r\n");
    }
}
Exemplo n.º 13
0
void CSD_Establish(char* csdNumber)
{
    char strCsdDialAT[30];
    s32 len = Ql_sprintf(strCsdDialAT, "ATD%s\r\n", csdNumber);
    APP_DEBUG("<-- Dialing CSD number: %s -->\r\n", csdNumber);
    Ql_UART_Write(m_myVirtualPort, strCsdDialAT, len);
}
Exemplo n.º 14
0
void proc_main_task()
{
    s32 ret;
    ST_MSG msg;
    bool keepGoing = TRUE;
    
 

    // Register & open UART port
    Ql_UART_Register(UART_PORT1, CallBack_UART_Hdlr, NULL);
    Ql_UART_Open(UART_PORT1, 115200, FC_NONE);

    Ql_UART_Register(UART_PORT2, CallBack_UART_Hdlr, NULL);
    Ql_UART_Open(UART_PORT2, 115200, FC_NONE);

    APP_DEBUG("\r\n<--OpenCPU: IIC TEST!-->\r\n"); 

    while (keepGoing)
    {
         Ql_OS_GetMessage(&msg);
        switch(msg.message)
        {
        case 0:
            break;
        default:
            break;
        }
        
    }

}
Exemplo n.º 15
0
static int app_server_reboot(void)
{

    APP_DEBUG("Reboot from server\n");
    /* should not return from rebooting the system */
    return 0;
}
idigi_callback_status_t iDigiFileSystem::app_process_file_stat(idigi_file_stat_request_t * const request_data,
                                                     idigi_file_stat_response_t * const response_data)
{
    idigi_file_stat_t *pstat = &response_data->statbuf;
    idigi_callback_status_t status = idigi_callback_continue;

    SdFile entry = DigiSD.open(request_data->path);

    if (!entry.isOpen())
    {
     	APP_DEBUG("stat cannot open: %s\n", request_data->path);
        goto done;   	
    }

    pstat->last_modified = 0;					// Last modified date unsupported:
    pstat->hash_alg = idigi_file_hash_none;	// File hash not supported
    pstat->file_size = (size_t) entry.fileSize();
    pstat->flags = 0;
    if (entry.isDir())
    	pstat->flags |= IDIGI_FILE_IS_DIR;
    else
    	pstat->flags |= IDIGI_FILE_IS_REG;

    entry.close();

done:
    return status;
}
idigi_callback_status_t iDigiFileSystem::app_process_file_opendir(idigi_file_path_request_t * const request_data,
                                                        idigi_file_open_response_t * const response_data)
{
    idigi_callback_status_t status = idigi_callback_continue;
    SdFile *dir = new SdFile;

    if (dir == NULL)
    {
    	response_data->error->error_status = idigi_file_out_of_memory;
    }

    *dir = DigiSD.open(request_data->path);

    if (!dir->isOpen() || !dir->isDir())
    {
    	response_data->error->error_status = idigi_file_path_not_found;
    	return status;
    }

    dir->rewind();

    response_data->handle = dir;
    APP_DEBUG("opendir for %s returned %p\n", request_data->path, (void *) dir);

    return status;
}
idigi_callback_status_t iDigiFileSystem::app_process_file_open(idigi_file_open_request_t * const request_data,
                                                     idigi_file_open_response_t * const response_data)
{
	idigi_callback_status_t status = idigi_callback_continue;

	SdFile *file = new SdFile;
	uint8_t filemode = 0;

    if (request_data->oflag & IDIGI_O_RDONLY) filemode |= O_RDONLY;
    if (request_data->oflag & IDIGI_O_WRONLY) filemode |= O_WRONLY;
    if (request_data->oflag & IDIGI_O_RDWR) filemode |= O_RDWR;
    if (request_data->oflag & IDIGI_O_APPEND) filemode |= O_APPEND;
    if (request_data->oflag & IDIGI_O_CREAT) filemode |= O_CREAT;
    if (request_data->oflag & IDIGI_O_TRUNC) filemode |= O_TRUNC;

    if ((request_data->oflag & (IDIGI_O_RDONLY | IDIGI_O_WRONLY)) == 0)
    	filemode |= O_RDONLY; 

    *file = DigiSD.open(request_data->path, filemode);

    if (!file->isOpen())
    {
        response_data->error->error_status = idigi_file_path_not_found;
    	return status;
    }

    APP_DEBUG("Open %s, req flag %d, flag %d, returned %p\n", request_data->path, request_data->oflag, filemode, (void *) file);

    response_data->handle = (void *) file;
    response_data->user_context = NULL;

    return status;
}
Exemplo n.º 19
0
static s32 ReadSerialPort(Enum_SerialPort port, /*[out]*/u8* pBuffer, /*[in]*/u32 bufLen)
{
    s32 rdLen = 0;
    s32 rdTotalLen = 0;
    int loopi = 0;
    if (NULL == pBuffer || 0 == bufLen)
    {
        return -1;
    }
    Ql_memset(pBuffer, 0x0, bufLen);
    while (1)
    {
        rdLen = Ql_UART_Read(port, pBuffer + rdTotalLen, bufLen - rdTotalLen);       
        if (rdLen <= 0)  // All data is read out, or Serial Port Error!
        {
            break;
        }
        rdTotalLen += rdLen;
        // Continue to read...
    }
    if (rdLen < 0) // Serial Port Error!
    {
        APP_DEBUG("Fail to read from port[%d]\r\n", port);
        return -99;
    }
    return rdTotalLen;
}
Exemplo n.º 20
0
void proc_main_task(void)
{
    s32 ret;
    ST_MSG msg;
    bool keepGoing = TRUE;

        // Init serial port
    InitializeSerialPort();

    APP_DEBUG(MY_FILE_TAG);
    


    // START MESSAGE LOOP OF THIS TASK
    while (keepGoing)
    {
         Ql_OS_GetMessage(&msg);
        switch(msg.message)
        {
           
            case 0:
            {                
                break;
            }            
            default:
                break;
          
        }        
    }

}
Exemplo n.º 21
0
void proc_main_task(s32 taskId)
{
    s32 ret;
    ST_MSG msg;

    // Register & open UART port
    ret = Ql_UART_Register(UART_PORT1, CallBack_UART_Hdlr, NULL);
    if (ret < QL_RET_OK)
    {
        Ql_Debug_Trace("Fail to register serial port[%d], ret=%d\r\n", m_myUartPort, ret);
    }
    ret = Ql_UART_Open(UART_PORT1, 115200, FC_NONE);
    if (ret < QL_RET_OK)
    {
        Ql_Debug_Trace("Fail to open serial port[%d], ret=%d\r\n", m_myUartPort, ret);
    }

    APP_DEBUG("\r\n<-- OpenCPU: ADC Example -->\r\n") 
        
    // Start to program ADC
    ADC_Program();

    // Start message loop of this task
    while (TRUE)
    {
        Ql_OS_GetMessage(&msg);
        switch(msg.message)
        {
        case MSG_ID_USER_START:
            break;
        default:
            break;
        }
    }
}
Exemplo n.º 22
0
bool SendMtkBinCmd(u8 *strCmd)
{
        int len = 0,ret = 0;
        unsigned char outBuffer[256];
    
	// At initial, the protocol setting of the communication UART is supposed to be PMTK protocol.
	// Since EPO data are transferred using MTK Binary Packet, you have to change the protocol setting to MTK Binary Protocol
	// before starting EPO Transfer Protocol. You can use PMTK command 253 to change the UART protocol setting.
	// Please refer to 7.1 for the details of PMTK command 253.

        Ql_memset(outBuffer,0,sizeof(outBuffer));                
        Ql_memcpy((void *)outBuffer, strCmd, Ql_strlen(strCmd));
        len = Ql_strlen(outBuffer);
        outBuffer[len++] = 0x0D;
        outBuffer[len++] = 0x0A;
        outBuffer[len] = '\0';   
   
	/*send the data of outBuffer to the GPS module example L70 ect. */
        ret = Ql_UART_Write(m_gnssUartPort,outBuffer,len);
        if (ret < len)
        {
            APP_DEBUG("SendMtkBinCmd Only part of bytes are written, %d/%d \r\n", ret, len);
            return FALSE;
        }
        
        return TRUE;	

}
Exemplo n.º 23
0
idigi_status_t app_send_put_request(idigi_handle_t handle)
{
    idigi_status_t status = idigi_no_resource;
    static idigi_data_service_put_request_t header; /* idigi connector will hold this until we get a response/error callback */
    static char const file_path[] = "test/test.txt";
    static char const file_type[] = "text/plain";
    static char const buffer[] = "iDigi data service sample\n";
    client_data_t * const app_data = malloc(sizeof *app_data);

    if (app_data == NULL)
        goto error;

    app_data->data_ptr = buffer;
    app_data->bytes = strlen(buffer);
    header.flags = IDIGI_DATA_PUT_APPEND;
    header.path  = file_path;
    header.content_type = file_type;
    header.context = app_data; /* will be returned in all subsequent callbacks */

    status = idigi_initiate_action(handle, idigi_initiate_data_service, &header, NULL);
    APP_DEBUG("Status: %d, file: %s\n", status, file_path);
    if (status != idigi_success)
        free(app_data);

error:
    return status;
}
Exemplo n.º 24
0
bool PeerConnector::IsBusy() const
{
	int maxConn = m_AppModule.GetSysInfo().MaxConnectPendingCount;

#if 0
	maxConn = 10;
#pragma message("!!!!!使用固定的并发连接限制值10")
#endif

	int pendingCount = tcp_socket::pending_connection_count();
	APP_DEBUG("TCPConnectIsBusy: " << make_tuple(maxConn, pendingCount, GetTotalPendingPeerCount()));
	//? 是否需要考虑对maxConn加以限制
	LIMIT_MAX(maxConn, 100);
// 	if (pendingCount < (int)GetTotalPendingPeerCount())
// 	{
// 		// 取pendingCount和m_PendingConnections中个数的最大值
// 		pendingCount = (int)GetTotalPendingPeerCount();
// 	}
	if (pendingCount < (int)m_TCPConnector->GetConnectingPeerCount())
	{
		// 取pendingCount和m_PendingConnections中个数的最大值
		pendingCount = (int)m_TCPConnector->GetConnectingPeerCount();
	}
	return pendingCount >= maxConn;
}
Exemplo n.º 25
0
void callback_socket_close(s32 socketId, s32 errCode, void* customParam )
{
    m_nSentLen  = 0;
    
    if (errCode == SOC_SUCCESS)
    {
        APP_DEBUG("<--CallBack: close socket successfully.-->\r\n"); 
    }else if(errCode == SOC_BEARER_FAIL)
    {   
        m_tcp_state = STATE_GPRS_DEACTIVATE;
        APP_DEBUG("<--CallBack: close socket failure,(socketId=%d,error_cause=%d)-->\r\n",socketId,errCode); 
    }else
    {
        m_tcp_state = STATE_GPRS_GET_DNSADDRESS;
        APP_DEBUG("<--CallBack: close socket failure,(socketId=%d,error_cause=%d)-->\r\n",socketId,errCode); 
    }
}
Exemplo n.º 26
0
static void InitializeSerialPort(void)
{
    s32 ret;

    // Register & open UART port
    // UART1 for MCU
    ret = Ql_UART_Register(m_mcuUartPort, CallBack_UART_Hdlr, NULL);
    if (ret < QL_RET_OK)
    {
        Ql_Debug_Trace("Fail to register serial port[%d], ret=%d\r\n", m_mcuUartPort, ret);
    }
    ret = Ql_UART_Open(m_mcuUartPort, 115200, FC_NONE);
    if (ret < QL_RET_OK)
    {
        Ql_Debug_Trace("Fail to open serial port[%d], ret=%d\r\n", m_mcuUartPort, ret);
    }    

    // Register & open UART port
    // UART3 for MCU
    ret = Ql_UART_Register(m_gnssUartPort, CallBack_UART_Hdlr, NULL);
    if (ret < QL_RET_OK)
    {
        APP_DEBUG("Fail to register serial port[%d], ret=%d\r\n", m_gnssUartPort, ret);
    }
    ret = Ql_UART_Open(m_gnssUartPort, 9600, FC_NONE);
    if (ret < QL_RET_OK)
    {
        APP_DEBUG("Fail to open serial port[%d], ret=%d\r\n", m_gnssUartPort, ret);
    }
    

    // Register & open Modem port
    ret = Ql_UART_Register(m_myVirtualPort, CallBack_UART_Hdlr, NULL);
    if (ret < QL_RET_OK)
    {
        APP_DEBUG("Fail to register serial port[%d], ret=%d\r\n", m_myVirtualPort, ret);
    }
    ret = Ql_UART_Open(m_myVirtualPort, 0, FC_NONE);
    if (ret < QL_RET_OK)
    {
        APP_DEBUG("Fail to open serial port[%d], ret=%d\r\n", m_myVirtualPort, ret);
    }

    return;
}
Exemplo n.º 27
0
/*
 * This routine reads a specified number of bytes from the iDigi server.  This 
 * function must not block. If it encounters EAGAIN or EWOULDBLOCK error, 0 
 * bytes must be returned and IIK will continue calling this function.
 */
static idigi_callback_status_t app_network_receive(idigi_read_request_t * read_data, size_t * read_length)
{
    idigi_callback_status_t rc = idigi_callback_continue;
    struct timeval timeout;
    fd_set read_set;
    int ccode, err;

    timeout.tv_sec = read_data->timeout;
    timeout.tv_usec = 0;

    *read_length = 0;

    FD_ZERO(&read_set);
    FD_SET(*read_data->network_handle, &read_set);

    /* Blocking point for IIK */
    ccode = select(*read_data->network_handle+1, &read_set, NULL, NULL, &timeout);
    if (ccode < 0)
    {
        goto done;
    }

    if (!FD_ISSET(*read_data->network_handle, &read_set))
    {
        rc = idigi_callback_busy;
        goto done;
    }
    ccode = recv(*read_data->network_handle, (char *)read_data->buffer, (int)read_data->length, 0);

    if (ccode == 0)
    {
        /* EOF on input: the connection was closed. */
        APP_DEBUG("network_receive: EOF on socket\r\n");
        errno = ECONNRESET;
        rc = idigi_callback_abort;
    }
    else if (ccode < 0)
    {
        /* An error of some sort occurred: handle it appropriately. */
        err = errno;
        if (err == EAGAIN || err == EWOULDBLOCK)
        {
            rc = idigi_callback_busy;
        }
        else
        {
            perror("network_receive: recv() failed");
            /* if not timeout (no data) return an error */
            rc = idigi_callback_abort;
        }
    }

    *read_length = (size_t)ccode;
done:

    return rc;
}
static idigi_callback_status_t app_process_action_end(idigi_remote_group_request_t const * const request,
                                                      idigi_remote_group_response_t * const response)
{
    APP_DEBUG("app_process_action_end\n");

    UNUSED_ARGUMENT(request);
    UNUSED_ARGUMENT(response);
    return idigi_callback_continue;
}
Exemplo n.º 29
0
int main (void)
{
    int status=EXIT_FAILURE;
    idigi_handle_t idigi_handle;

    APP_DEBUG("main: Starting iDigi\n");
    idigi_handle = idigi_init((idigi_callback_t) app_idigi_callback);
    if (idigi_handle == NULL)
    {
        APP_DEBUG("main: idigi_init() failed\n");
        goto done;
    }

    /* Sample program control loop */
    for(;;)
    {
        idigi_status_t status;
        /*
         * Example of using idigi_step(), we run a portion of the IIK then run
         * a portion of the users application.
         */
        status = idigi_step(idigi_handle);
        if (status != idigi_success && status != idigi_receive_error &&
            status != idigi_send_error && status != idigi_connect_error)
        {
            /* We exclude idigi_receive_error, idigi_send_error, &
             * idigi_connect_error. We want to reconnect iDigi
             * even if idigi_step returns error in receive, send, or connect.
             */
            APP_DEBUG("main: idigi_step() failed\n");
            break;
        }
        if (application_step(idigi_handle) != 0)
        {
            APP_DEBUG("main: application_step() failed\n");
            goto done;
        }
        usleep(1000);
    }

done:
    return status;
}
Exemplo n.º 30
0
void callback_socket_connect(s32 socketId, s32 errCode, void* customParam )
{
    if (errCode == SOC_SUCCESS)
    {
        if (timeout_90S_monitor) //stop timeout monitor
        {
           Ql_Timer_Stop(TIMEOUT_90S_TIMER_ID);
           timeout_90S_monitor = FALSE;
        }

        APP_DEBUG("<--Callback: socket connect successfully.-->\r\n");
        m_tcp_state = STATE_SOC_SEND;
    }else
    {
        APP_DEBUG("<--Callback: socket connect failure,(socketId=%d),errCode=%d-->\r\n",socketId,errCode);
        Ql_SOC_Close(socketId);
        m_tcp_state = STATE_SOC_CREATE;
    }
}