sercomm/osmocon cant send CMD after PROMPT1

Nathan Fain nat at fains.com
Sun Mar 14 15:04:03 UTC 2010


I'm running into a problem with sercomm.  oscmocon is unable to write()
the CMD after PROMPT1 is received.  I've attached a quick python client
that checks from PROMPT1 and then sends CMD to confirm that it responds and
its not something with the local system (OSX).

Relevant code with some added debugging:
static int handle_read(void) 
{
  if (!memcmp(buffer, phone_prompt1, sizeof(phone_prompt1))) {
    printf("Received PROMPT1 from phone, responding with CMD\n");
    dnload.print_hdlc = 0;
    dnload.state = WAITING_PROMPT2;
    rc = write(dnload.serial_fd.fd, dnload_cmd, sizeof(dnload_cmd));
    /* not in src, added for debugging: */
    if (rc <= 0) {
      printf("error writing CMD to serial\n");
      exit(1);
    }
...


$ ./osmocon -m c155 -p /dev/tty.usbserial \
  ../../target/firmware/board/compal_e99/hello_world.bin 
got 1 bytes from modem, data looks like: 1b 
got 6 bytes from modem, data looks like: f6 02 00 41 01 40 
Received PROMPT1 from phone, responding with CMD
could not write CMD to serial



Output from python script:
(if you try this, be sure to set your serial port and change the python2.5
call on line 1)
$ ./compalserialtest.py 115200
got byte(s) from phone: 1b
got byte(s) from phone: f6
got byte(s) from phone: 02
got byte(s) from phone: 00
got byte(s) from phone: 41
got byte(s) from phone: 01
recieved PROMPT1 from phone. Writing CMD
got byte(s) from phone: 1b
got byte(s) from phone: f6
got byte(s) from phone: 02
got byte(s) from phone: 00
got byte(s) from phone: 41
got byte(s) from phone: 02
got byte(s) from phone: 43

-- 
cyphunk://cypherpoet.com
nathan://squimp.com
fain://deadhacker.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compalserialtest.py
Type: text/x-python-script
Size: 1905 bytes
Desc: not available
URL: <http://lists.osmocom.org/pipermail/baseband-devel/attachments/20100314/ff7310fb/attachment.bin>


More information about the baseband-devel mailing list