Changeset 70


Ignore:
Timestamp:
10/09/06 23:00:45 (7 years ago)
Author:
laforge
Message:

intermediate state (this shouldn't be a commit) just to move from one machine to the other

Location:
trunk/src/target/gsm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/gsm/include/libgsmd/libgsmd.h

    r40 r70  
    3535extern int lgsm_exit(struct lgsm_handle *lh);  
    3636 
     37/* Obtain file descriptor (e.g. for select-loop under app control) */ 
     38extern int lgsm_fd(struct lgsm_handle *lh); 
     39 
    3740/* Refer to GSM 04.08 [8] subclause 10.5.4.7 */ 
    3841enum lgsm_addr_type { 
  • trunk/src/target/gsm/src/gsmd/gsmd.c

    r40 r70  
    3333        cmd = atcmd_fill("AT+CLCK=?", 255, &gsmd_test_atcb, NULL); 
    3434        return atcmd_submit(gsmd, cmd); 
     35} 
     36 
     37static int gsmd_initsettings(struct gsmd *gsmd) 
     38{ 
     39        struct gsmd_atcmd *cmd; 
     40        //cmd = atcmd_fill("ATV1;+CRC=1;+CREG=2;+CLIP=1;+COLP=1", 255, &f 
    3541} 
    3642 
  • trunk/src/target/gsm/src/libgsmd/libgsmd.c

    r40 r70  
    44#include <stdio.h> 
    55#include <string.h> 
     6#include <errno.h> 
    67 
    78#include <sys/types.h> 
     
    1213 
    1314#include "lgsm_internals.h" 
     15 
     16static int lgsm_get_packet(struct lgsm_handle *lh) 
     17{ 
     18        static char buf[GSMD_MSGSIZE_MAX]; 
     19        struct gsmd_msg_hdr *hdr = (struct gsmd_msg_hdr *) buf; 
     20        int rc = read(lh->fd, buf, sizeof(buf)); 
     21        if (rc <= 0) 
     22                return rc; 
     23 
     24        if (hdr->version != GSMD_PROTO_VERSION) 
     25                return -EINVAL; 
     26         
     27        switch (hdr->msg_type) { 
     28        case GSMD_MSG_PASSTHROUGH: 
     29                 
     30                break; 
     31        default: 
     32                return -EINVAL; 
     33        } 
     34 
     35        return 0; 
     36} 
     37 
    1438 
    1539static int lgsm_open_backend(struct lgsm_handle *lh, const char *device) 
     
    3458                        return rc; 
    3559                } 
    36         } else { 
    37                 /* use direct access to device node ([virtual] tty device) */ 
    38                 lh->fd = open(device, O_RDWR); 
    39                 if (lh->fd < 0) 
    40                         return lh->fd; 
    41         } 
    42          
     60        } else   
     61                return -EINVAL; 
     62 
    4363        return 0; 
     64} 
     65 
     66int lgsm_fd(struct lgsm_handle *lh) 
     67{ 
     68        return lh->fd; 
    4469} 
    4570 
Note: See TracChangeset for help on using the changeset viewer.