summaryrefslogtreecommitdiff
path: root/include/emulator.h
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2011-02-15 15:46:51 -0600
committerDenis Kenzior <denkenz@gmail.com>2011-02-15 15:47:32 -0600
commit1ded74f2df5d74f777a499efaf45bc862cafaf9a (patch)
treeef1745087ab14d4194459685e34e728eb8b47e92 /include/emulator.h
parenta6f910e27cdae6f44b767767dae6190a0affe438 (diff)
downloadofono-1ded74f2df5d74f777a499efaf45bc862cafaf9a.tar.gz
emulator: Add basic API for emulator
Diffstat (limited to 'include/emulator.h')
-rw-r--r--include/emulator.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/emulator.h b/include/emulator.h
index 2334e023..93373477 100644
--- a/include/emulator.h
+++ b/include/emulator.h
@@ -29,11 +29,23 @@ extern "C" {
#include <ofono/types.h>
struct ofono_emulator;
+struct ofono_emulator_request;
enum ofono_emulator_type {
OFONO_EMULATOR_TYPE_DUN,
};
+enum ofono_emulator_request_type {
+ OFONO_EMULATOR_REQUEST_TYPE_COMMAND_ONLY,
+ OFONO_EMULATOR_REQUEST_TYPE_QUERY,
+ OFONO_EMULATOR_REQUEST_TYPE_SUPPORT,
+ OFONO_EMULATOR_REQUEST_TYPE_SET,
+};
+
+typedef void (*ofono_emulator_request_cb_t)(struct ofono_emulator *em,
+ struct ofono_emulator_request *req,
+ void *data);
+
struct ofono_emulator *ofono_emulator_create(struct ofono_modem *modem,
enum ofono_emulator_type type);
@@ -41,6 +53,27 @@ void ofono_emulator_register(struct ofono_emulator *em, int fd);
void ofono_emulator_remove(struct ofono_emulator *em);
+void ofono_emulator_send_final(struct ofono_emulator *em,
+ const struct ofono_error *final);
+void ofono_emulator_send_unsolicited(struct ofono_emulator *em,
+ const char *result);
+void ofono_emulator_send_intermediate(struct ofono_emulator *em,
+ const char *result);
+void ofono_emulator_send_info(struct ofono_emulator *em, const char *line,
+ ofono_bool_t last);
+
+ofono_bool_t ofono_emulator_request_next_string(
+ struct ofono_emulator_request *req,
+ const char **str);
+ofono_bool_t ofono_emulator_request_next_number(
+ struct ofono_emulator_request *req,
+ int *number);
+
+const char *ofono_emulator_request_get_raw(struct ofono_emulator_request *req);
+
+enum ofono_emulator_request_type ofono_emulator_request_get_type(
+ struct ofono_emulator_request *req);
+
#ifdef __cplusplus
}
#endif