r12 - in trunk/src/target: . libgsmd libgsmd/include libgsmd/include/libgsmd
laforge at gta01.hmw-consulting.de
laforge at gta01.hmw-consulting.de
Tue Aug 15 20:31:08 CEST 2006
Author: laforge
Date: 2006-08-15 18:31:07 +0000 (Tue, 15 Aug 2006)
New Revision: 12
Added:
trunk/src/target/libgsmd/
trunk/src/target/libgsmd/include/
trunk/src/target/libgsmd/include/libgsmd/
trunk/src/target/libgsmd/include/libgsmd/event.h
trunk/src/target/libgsmd/include/libgsmd/handset.h
trunk/src/target/libgsmd/include/libgsmd/libgsmd.h
trunk/src/target/libgsmd/include/libgsmd/misc.h
trunk/src/target/libgsmd/include/libgsmd/phonebook.h
trunk/src/target/libgsmd/include/libgsmd/voicecall.h
Log:
initial checkin of current libgsmd API definition
Added: trunk/src/target/libgsmd/include/libgsmd/event.h
===================================================================
--- trunk/src/target/libgsmd/include/libgsmd/event.h 2006-08-11 01:35:22 UTC (rev 11)
+++ trunk/src/target/libgsmd/include/libgsmd/event.h 2006-08-15 18:31:07 UTC (rev 12)
@@ -0,0 +1,61 @@
+#ifndef _LIBGSMD_EVENT_H
+#define _LIBGSMD_EVENT_H
+
+#include <libgsmd/libgsmd.h>
+
+enum lgsm_events {
+ LGSM_EVT_NONE = 0,
+ LGSM_EVT_IN_CALL_VOICE = 1, /* Incoming VOICE call */
+ LGSM_EVT_IN_CALL_DATA = 2, /* Incoming DATA call */
+ LGSM_EVT_IN_CALL_FAX = 3, /* Incoming FAX call */
+ LGSM_EVT_IN_SMS = 4, /* Incoming SMS */
+ LGSM_EVT_IN_GPRS = 5, /* Network initiated GPRS */
+ LGSM_EVT_NETREG = 6, /* Network (un)registration event */
+ LGSM_EVT_SIGNAL = 7, /* Signal quality event */
+ LGSM_EVT_PIN = 8, /* Modem is waiting for some PIN/PUK */
+ LGSM_EVT_OUT_STATUS = 9, /* Outgoing call status */
+};
+
+/* Chapter 8.3 */
+enum lgsm_pin_type { /* waiting for ... */
+ LGSM_PIN_NONE = 0, /* not for any PIN */
+ LGSM_PIN_SIM_PIN = 1, /* SIM PIN */
+ LGSM_PIN_SIM_PUK = 2, /* SIM PUK */
+ LGSM_PIN_PH_SIM_PIN = 3, /* phone-to-SIM passowrd */
+ LGSM_PIN_PH_FSIM_PIN = 4, /* phone-to-very-first SIM password */
+ LGSM_PIN_PH_FSIM_PUK = 5, /* phone-to-very-first SIM PUK password */
+ LGSM_PIN_SIM_PIN2 = 6, /* SIM PIN2 */
+ LGSM_PIN_SIM_PUK2 = 7, /* SIM PUK2 */
+ LGSM_PIN_PH_NET_PIN = 8, /* netwokr personalisation password */
+ LGSM_PIN_PH_NET_PUK = 9, /* network personalisation PUK */
+ LGSM_PIN_PH_NETSUB_PIN = 10, /* network subset personalisation PIN */
+ LGSM_PIN_PH_NETSUB_PUK = 11, /* network subset personalisation PUK */
+ LGSM_PIN_PH_SP_PIN = 12, /* service provider personalisation PIN */
+ LGSM_PIN_PH_SP_PUK = 13, /* service provider personalisation PUK */
+ LGSM_PIN_PH_CORP_PIN = 14, /* corporate personalisation PIN */
+ LGSM_PIN_PH_CORP_PUK = 15, /* corporate personalisation PUK */
+};
+
+struct lgsm_evt_auxdata {
+ union {
+ struct {
+ struct lgsm_addr addr;
+ } call;
+ struct {
+ /* TBD */
+ } sms;
+ struct {
+ enum lgsm_pin_type type;
+ } pin;
+ } u;
+};
+
+/* Prototype of libgsmd callback handler function */
+typedef int evt_cb_func(struct lgsm_handle *lh, enum lgsm_events evt,
+ void *user);
+
+/* Register an event callback handler with libgsmd */
+extern int lgsm_register_evt_cb(struct lgsm_handle *lh,
+ evt_cb_func *cb, void *user);
+
+#endif
Added: trunk/src/target/libgsmd/include/libgsmd/handset.h
===================================================================
--- trunk/src/target/libgsmd/include/libgsmd/handset.h 2006-08-11 01:35:22 UTC (rev 11)
+++ trunk/src/target/libgsmd/include/libgsmd/handset.h 2006-08-15 18:31:07 UTC (rev 12)
@@ -0,0 +1,15 @@
+#ifndef _LIBGSMD_HANDSET_H
+#define _LIBGSMD_HANDSET_H
+
+#include <libgsmd/libgsmd.h>
+/* Set speaker level (Chapter 8.23) */
+extern int lgsm_set_spkr_level(struct lgsm_handle *lh,
+ u_int32_t level);
+
+/* Mute call during voice call */
+extern int lgsm_mute_set(struct lgsm_handle *lh, u_int8_t on);
+
+/* Get information on whether voice call is muted or not */
+extern int lgsm_mute_get(struct lgsm_handle *lh, u_int8_t *on);
+
+#endif
Added: trunk/src/target/libgsmd/include/libgsmd/libgsmd.h
===================================================================
--- trunk/src/target/libgsmd/include/libgsmd/libgsmd.h 2006-08-11 01:35:22 UTC (rev 11)
+++ trunk/src/target/libgsmd/include/libgsmd/libgsmd.h 2006-08-15 18:31:07 UTC (rev 12)
@@ -0,0 +1,50 @@
+#ifndef _LIBGSMD_H
+#define _LIBGSMD_H
+
+/* libgsmd.h - Library API for gsmd, the GSM Daemon
+ * (C) 2006 by Harald Welte <hwelte at hmw-consulting.de>
+ * Development funded by First International Computers, Inc.
+ */
+
+#include <sys/types.h>
+#include <errno.h>
+
+/* Generic Information
+ *
+ * Return value:
+ * < 0 Error, see libgsmd/errno.h and errno.h
+ * = 0 Success
+ * > 0 Success, number of information elements returned
+ *
+ * Allocation:
+ * All data structures are caller-allocated. The only exception
+ * is struct lgsm_handle which is allocatedi in lgsm_init() and
+ * free'd in lgsm_exit()
+ *
+ * References:
+ * Recefences to "Chapter X" are referring to 3GPP TS 07.07 version 7.8.0
+ */
+
+/* Opaque data structure, content only known to libgsm implementation */
+struct lgsm_handle;
+
+/* initialize usage of libgsmd, obtain handle for othe API calls */
+extern struct lgsm_handle *lgsm_init(void);
+
+/* Terminate usage of libgsmd */
+extern int lgsm_exit(struct lgsm_handle *lh);
+
+/* Refer to GSM 04.08 [8] subclause 10.5.4.7 */
+enum lgsm_addr_type {
+ LGSM_ATYPE_ISDN_UNKN = 161,
+ LGSM_ATYPE_ISDN_INTL = ,
+ LGSM_ATYPE_ISDN_NATIONAL = ,
+};
+
+#define LGSM_ADDR_MAXLEN 31
+struct lgsm_addr {
+ char addr[LGSM_ADDR_MAXLEN+1];
+ enum lgsm_addr_type tyoe;
+};
+
+#endif
Added: trunk/src/target/libgsmd/include/libgsmd/misc.h
===================================================================
--- trunk/src/target/libgsmd/include/libgsmd/misc.h 2006-08-11 01:35:22 UTC (rev 11)
+++ trunk/src/target/libgsmd/include/libgsmd/misc.h 2006-08-15 18:31:07 UTC (rev 12)
@@ -0,0 +1,72 @@
+#ifndef _LIBGSMD_H
+#define _LIBGSMD_H
+
+/* libgsmd.h - Library API for gsmd, the GSM Daemon
+ * (C) 2006 by Harald Welte <hwelte at hmw-consulting.de>
+ * Development funded by First International Computers, Inc.
+ */
+
+#include <libgsmd/libgsmd.h>
+
+enum lgsm_netreg_state {
+ LGSM_NETREG_ST_NOTREG = 0,
+ LGSM_NETREG_ST_REG_HOME = 1,
+ LGSM_NETREG_ST_NOTREG_SEARCH = 2,
+ LGSM_NETREG_ST_DENIED = 3,
+ LGSM_NETREG_ST_UNKNOWN = 4,
+ LGSM_NETREG_ST_REG_ROAMING = 5,
+};
+
+/* Get the current network registration status */
+extern int lgsm_get_netreg_state(struct lgsm_handle *lh,
+ enum lgsm_netreg_state *state);
+
+enum lgsm_info_type {
+ LGSM_INFO_TYPE_NONE = 0,
+ LGSM_INFO_TYPE_MANUF = 1,
+ LGSM_INFO_TYPE_MODEL = 2,
+ LGSM_INFO_TYPE_REVISION = 3,
+ LGSM_INFO_TYPE_SERIAL = 4,
+ LGSM_INFO_TYPE_IMSI = 5,
+};
+
+/* Get some information about the handset */
+extern int lgsm_get_info(struct lgsm_handle *lh,
+ enum lgsm_info_type type,
+ char *ret_string, u_int16_t len);
+
+/* Authenticate to SIM Card using specified null-terminated pin */
+extern int lgsm_pin_auth(struct lgsm_handle *lh, const char *pin);
+
+
+/* General Commands */
+
+/* Get Signal Strehngth (Chapter 8.5) */
+extern int lgsm_get_signal_quality(struct lgsm_handle *h,
+ unsigned int *rssi);
+
+/* Set voice mail number */
+extern int lgsm_voicemail_set(struct lgsm_handle *lh,
+ struct lgsm_addr *addr);
+
+/* Get currently configured voice mail number */
+extern int lgsm_voicemail_get(struct lgsm_handle *lh,
+ struct lgsm_addr *addr);
+
+/* Operator Selection, Network Registration */
+/* TBD */
+
+
+/* CLIP, CLIR, COLP, Call Forwarding, Call Waiting, Call Deflecting */
+/* TBD */
+
+
+/* SMS related functions */
+/* TBD */
+
+
+/* GPRS related functions */
+/* TBD */
+
+
+#endif
Added: trunk/src/target/libgsmd/include/libgsmd/phonebook.h
===================================================================
--- trunk/src/target/libgsmd/include/libgsmd/phonebook.h 2006-08-11 01:35:22 UTC (rev 11)
+++ trunk/src/target/libgsmd/include/libgsmd/phonebook.h 2006-08-15 18:31:07 UTC (rev 12)
@@ -0,0 +1,51 @@
+#ifndef _LIBGSMD_PBOOK_H
+#define _LIBGSMD_PBOOK_H
+
+#include <libgsmd/libgsmd.h>
+
+/* Phonebook */
+
+/* Chapter 8.11 */
+enum lgsm_pbook_type {
+ LGSM_PB_ME_DIALLED = 1,
+ LGSM_PB_SIM_EMERGENCY = 2,
+ LGSM_PB_SIM_FIXDIAL = 3,
+ LGSM_PB_SIM_DIALLED = 4,
+ LGSM_PB_ME_MISSED = 5,
+ LGSM_PB_ME_PHONEBOOK = 6,
+ LGSM_PB_COMB_PHONEBOOK = 7,
+ LGSM_PB_SIM_OWN_NUMBERS = 8,
+ LGSM_PB_ME_RECEIVED = 9,
+ LGSM_PB_SIM_PHONEBOOK = 10,
+ LGSM_PB_TA_PHONEBOOK = 11,
+};
+
+/* Get a bitmask of supported phonebook types */
+extern int lgsm_pb_get_types(struct lgsm_handle *lh, u_int32 *typemask);
+
+/* Get a range of supported indexes in given phonebook type, Chapter 8.12 */
+extern int lgsm_pb_get_range(struct lgsm_handle *lh,
+ enum lgsm_pbook_type type,
+ u_int32_t *from, u_int32_t *to,
+ u_int32_t *nlength, *u_int32_t tlength);
+
+#define LGSM_PB_TEXT_MAXLEN 31
+
+struct lgsm_pb_entry {
+ struct lgsm_pb_entry *next;
+ enum lgsm_pbook_type type;
+ u_int32_t index;
+ char text[LGSM_PB_TEXT_MAXLEN+1];
+};
+
+/* Get a specific phonebook entry and store it to 'pb'
+ * pb' is caller-allocated */
+extern int lgsm_pb_get_entry(struct lgsm_handle *lh,
+ struct lgsm_pb_entry *pb);
+
+/* Store a specific phonebook entry 'pb' into phone */
+extern int lgsm_pb_set_entry(struct lgsm_handle *lh,
+ struct lgsm_pb_entry *pb);
+
+
+#endif
Added: trunk/src/target/libgsmd/include/libgsmd/voicecall.h
===================================================================
--- trunk/src/target/libgsmd/include/libgsmd/voicecall.h 2006-08-11 01:35:22 UTC (rev 11)
+++ trunk/src/target/libgsmd/include/libgsmd/voicecall.h 2006-08-15 18:31:07 UTC (rev 12)
@@ -0,0 +1,18 @@
+#ifndef _LIBGSMD_VCALL_H
+#define _LIBGSMD_VCALL_H
+
+#include <libgsmd/libgsmd.h>
+
+/* Voice Calls */
+
+/* Initiate an outgoing voice call */
+extern int lgsm_voice_out_init(struct lgsm_handle *lh,
+ const struct lgsm_addr *number);
+
+/* Accept incoming voice call */
+extern int lgsm_voice_in_accept(struct lgsm_handle *lh);
+
+/* Terminate outgoing (or incoming) voice call */
+extern int lgsm_voice_hangup(struct lgsm_handle *lh);
+
+#endif
More information about the commitlog
mailing list