1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
/*
* oFono - Open Source Telephony
* Copyright (C) 2016 Canonical Ltd
*
* SPDX-License-Identifier: GPL-2.0-only
*/
struct engine_data;
enum test_step_type {
TST_ACTION_SEND,
TST_ACTION_CALL,
TST_EVENT_RECEIVE,
TST_EVENT_CALL,
};
typedef void (*rilmodem_test_engine_cb_t)(void *data);
struct rilmodem_test_step {
enum test_step_type type;
union {
/* For TST_ACTION_CALL */
rilmodem_test_engine_cb_t call_action;
/* For TST_ACTION_SEND or TST_EVENT_RECEIVE */
struct {
const char *parcel_data;
const size_t parcel_size;
};
/* For TST_EVENT_CALL */
struct {
void (*call_func)(void);
void (*check_func)(void);
};
};
};
struct rilmodem_test_data {
const struct rilmodem_test_step *steps;
int num_steps;
};
void rilmodem_test_engine_remove(struct engine_data *ed);
struct engine_data *rilmodem_test_engine_create(
rilmodem_test_engine_cb_t connect,
const struct rilmodem_test_data *test_data,
void *data);
void rilmodem_test_engine_write_socket(struct engine_data *ed,
const unsigned char *buf,
const size_t buf_len);
const char *rilmodem_test_engine_get_socket_name(struct engine_data *ed);
void rilmodem_test_engine_next_step(struct engine_data *ed);
const struct rilmodem_test_step *rilmodem_test_engine_get_current_step(
struct engine_data *ed);
void rilmodem_test_engine_start(struct engine_data *ed);
|