Friday, December 7, 2012

Caller ID project - part two

OK - it's been, ahem, "several" years since I've done any serious programming in C.

But, the way I see it, it's just like falling off a bike:  once you forget about it, it hurts more the next time you do it...

In any case, I've got a basic parser coded.  The pseudo code looks something like this right now:
Magically acquire Caller ID string 
Look for "MESG=80" in the input string 
If you find it 
    Retrieve the message length 
    While there's still message left to parse 
        Get the field type 
        Get the field length 
        Get the field 
    end while 
end if
I'm rather embarrassed to say that coding this took a couple of hours using Xcode on the Mac.  It's not pretty - it currently looks like the C equivalent of duct tape.  

Challenges:

Remember how to do string/array manipulation in C 
Convert strings of hex characters to numbers

Next steps
Clean up code (subroutine-ize it, abstract the code for field handling, make it pretty, etc.) 
Implement a read-string-from-USB function
Write date/time and number somewhere that the web server can find and use it
Figure out how to serve this information on a web server
Figure out how to get the information on an LCD display
Wire everything up
Put it in a case 
  




     
     

No comments:

Post a Comment