src/atchannel.c
/**
 * Internal send_command implementation
 *
 * timeoutMsec == 0 means infinite timeout
 */
Internal send_command implementation
timeoutMsec == 0 means infinite timeout
Internal send_command implementation timeoutMsec == 0 means infinite timeout
static ATReturn at_send_command_full(ATChannel* atch, const char *command, ATCommandType type,
                    const char *responsePrefix, const char *smspdu,
                    long long timeoutMsec, ATResponse **pp_outResponse)
{
    ATReturn err;
    if (0 != pthread_equal(atch->impl->tid_reader, pthread_self())) {
        return AT_ERROR_INVALID_THREAD;
    }
    pthread_mutex_lock(&atch->impl->commandmutex);
    err = at_send_command_full_nolock(atch, command, type,
                    responsePrefix, smspdu,
                    timeoutMsec, pp_outResponse);
    pthread_mutex_unlock(&atch->impl->commandmutex);
    if (err == AT_ERROR_TIMEOUT && atch->onTimeoutHandler != NULL) {
        atch->onTimeoutHandler(atch);
    }
    return err;
}
static ATReturn at_send_command_full ( ATChannel * atch , const char * command , ATCommandType type , const char * responsePrefix , const char * smspdu , long long timeoutMsec , ATResponse * * pp_outResponse ) { ATReturn err ; if ( 0 != pthread_equal ( atch -> impl -> tid_reader , pthread_self ( ) ) ) { return AT_ERROR_INVALID_THREAD ; } pthread_mutex_lock ( & atch -> impl -> commandmutex ) ; err = at_send_command_full_nolock ( atch , command , type , responsePrefix , smspdu , timeoutMsec , pp_outResponse ) ; pthread_mutex_unlock ( & atch -> impl -> commandmutex ) ; if ( err == AT_ERROR_TIMEOUT && atch -> onTimeoutHandler != NULL ) { atch -> onTimeoutHandler ( atch ) ; } return err ; }
Internal send_command implementation
 timeoutMsec == 0 means infinite timeout
Internal send_command implementation timeoutMsec == 0 means infinite timeout
/* cannot be called from reader thread */