Test Agents: Command Handler

Overview

Common Handler (CH) is an interface to hide the details of Test Agent implementation for Portable Command Handler (PCH). More…

// typedefs

typedef te_errno (*rcf_rtn)(
    void *arg,
    ...
    );

typedef te_errno (*rcf_thr_rtn)(
    void *sem,
    void *arg,
    ...
    );

typedef te_errno (*rcf_argv_rtn)(
    int argv,
    char **argc
    );

typedef te_errno (*rcf_argv_thr_rtn)(
    void *sem,
    int argc,
    char **argv
    );

// global functions

int rcf_ch_init(void);
void rcf_ch_lock(void);
void rcf_ch_unlock(void);

// macros

#define RCF_CH_LOCK
#define RCF_CH_UNLOCK
#define RCF_PCH_CFG_SUBST_SET(...)

Detailed Documentation

Common Handler (CH) is an interface to hide the details of Test Agent implementation for Portable Command Handler (PCH). When you support a new type of Test Agent you will need to implement only these set of functions to let other TE components access functionality exported by your Test Agent in generic way.

Definition of these functions could be found under ${TE_BASE}/agents/[agent type] directory.

Typedefs

typedef te_errno (*rcf_rtn)(
    void *arg,
    ...
    )

Generic routine prototype

typedef te_errno (*rcf_thr_rtn)(
    void *sem,
    void *arg,
    ...
    )

Generic threaded routine prototype

typedef te_errno (*rcf_argv_rtn)(
    int argv,
    char **argc
    )

argv/argc routine prototype

typedef te_errno (*rcf_argv_thr_rtn)(
    void *sem,
    int argc,
    char **argv
    )

argv/argc threaded routine prototype

Global Functions

int rcf_ch_init(void)

Initialize structures.

Returns:

Status code

void rcf_ch_lock(void)

Mutual exclusion lock access to data connection.

void rcf_ch_unlock(void)

Unlock access to data connection.

To be asynchronous cancellation safe, unlock should work fine in not locked state.

Macros

#define RCF_CH_LOCK

POSIX thread cancellation-unsafe lock access to data connection.

#define RCF_CH_UNLOCK

POSIX thread cancellation-unsafe unlock access to data connection.

#define RCF_PCH_CFG_SUBST_SET(...)

A convenience constructor to define substitutions