r70 - in trunk/src/target/gsm: include/libgsmd src/gsmd src/libgsmd
laforge at gta01.hmw-consulting.de
laforge at gta01.hmw-consulting.de
Mon Oct 9 23:00:46 CEST 2006
Author: laforge
Date: 2006-10-09 21:00:45 +0000 (Mon, 09 Oct 2006)
New Revision: 70
Modified:
trunk/src/target/gsm/include/libgsmd/libgsmd.h
trunk/src/target/gsm/src/gsmd/gsmd.c
trunk/src/target/gsm/src/libgsmd/libgsmd.c
Log:
intermediate state (this shouldn't be a commit) just to move from one machine to the other
Modified: trunk/src/target/gsm/include/libgsmd/libgsmd.h
===================================================================
--- trunk/src/target/gsm/include/libgsmd/libgsmd.h 2006-10-09 19:45:40 UTC (rev 69)
+++ trunk/src/target/gsm/include/libgsmd/libgsmd.h 2006-10-09 21:00:45 UTC (rev 70)
@@ -34,6 +34,9 @@
/* Terminate usage of libgsmd */
extern int lgsm_exit(struct lgsm_handle *lh);
+/* Obtain file descriptor (e.g. for select-loop under app control) */
+extern int lgsm_fd(struct lgsm_handle *lh);
+
/* Refer to GSM 04.08 [8] subclause 10.5.4.7 */
enum lgsm_addr_type {
LGSM_ATYPE_ISDN_UNKN = 161,
Modified: trunk/src/target/gsm/src/gsmd/gsmd.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/gsmd.c 2006-10-09 19:45:40 UTC (rev 69)
+++ trunk/src/target/gsm/src/gsmd/gsmd.c 2006-10-09 21:00:45 UTC (rev 70)
@@ -34,6 +34,12 @@
return atcmd_submit(gsmd, cmd);
}
+static int gsmd_initsettings(struct gsmd *gsmd)
+{
+ struct gsmd_atcmd *cmd;
+ //cmd = atcmd_fill("ATV1;+CRC=1;+CREG=2;+CLIP=1;+COLP=1", 255, &f
+}
+
struct bdrt {
int bps;
u_int32_t b;
Modified: trunk/src/target/gsm/src/libgsmd/libgsmd.c
===================================================================
--- trunk/src/target/gsm/src/libgsmd/libgsmd.c 2006-10-09 19:45:40 UTC (rev 69)
+++ trunk/src/target/gsm/src/libgsmd/libgsmd.c 2006-10-09 21:00:45 UTC (rev 70)
@@ -3,6 +3,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -12,6 +13,29 @@
#include "lgsm_internals.h"
+static int lgsm_get_packet(struct lgsm_handle *lh)
+{
+ static char buf[GSMD_MSGSIZE_MAX];
+ struct gsmd_msg_hdr *hdr = (struct gsmd_msg_hdr *) buf;
+ int rc = read(lh->fd, buf, sizeof(buf));
+ if (rc <= 0)
+ return rc;
+
+ if (hdr->version != GSMD_PROTO_VERSION)
+ return -EINVAL;
+
+ switch (hdr->msg_type) {
+ case GSMD_MSG_PASSTHROUGH:
+
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+
static int lgsm_open_backend(struct lgsm_handle *lh, const char *device)
{
int rc;
@@ -33,16 +57,17 @@
lh->fd = -1;
return rc;
}
- } else {
- /* use direct access to device node ([virtual] tty device) */
- lh->fd = open(device, O_RDWR);
- if (lh->fd < 0)
- return lh->fd;
- }
-
+ } else
+ return -EINVAL;
+
return 0;
}
+int lgsm_fd(struct lgsm_handle *lh)
+{
+ return lh->fd;
+}
+
struct lgsm_handle *lgsm_init(const char *device)
{
struct lgsm_handle *lh = malloc(sizeof(*lh));
More information about the commitlog
mailing list