Home made cellphone project.

 
 

But the phoneManager also has to deal with the seemingly random demands by other parts of the code demanding to communicate with the FONA.


“Send this text message!”

“Hang up the bloody phone!”

“Hey, I need to dial a number!”

“Is there a call coming in?”


In order to keep all this straight, the poneManager also inherits from linkList. Which just happens to be a link list manager. Using this ability, each communication is queued up and a messageID is passed back. This is used by the calling section of the code to keep track of its message and get its reply.

Last code piece, I swear!

One of the last big pieces I needed to put together was a reliable way to communicate between the Teensy and the FeatherFONA. This lead to writing the LC_quickCom library.


The LC_quickCom library has two classes, qCMaster for the master processor and qCSlave for the slave processor. This is not a peer to peer kind’a thing. One’s the boss and that’s that. In this case, the Teensy is the master. It starts all communication. And the FeatherFONA replies. This ensures everything is kept in sync.


The format for all messages is one byte telling how many bytes follow, and the rest just raw data bytes. Simple as that. And, its all run behind the scenes using idle time.


qCMaster has dynamically sized buffers etc. qCSlave uses no dynamic memory. Everything on qCSlave is fixed at compile time to minimize memory footprint. Remember, only 2k of RAM over there.


Now, remember the phoneManager class we talked about earlier? The class that idled along chatting with the FeatherFONA?  The phoneManager is actually a qCMaster. Well, amongst other things. This is how it is able to communicate with the FeatherFONA. Its basically built into its DNA.

Welcome to the machine.

In the middle of coding frantically for weeks, I, at one point, fired up the FONA to check something. Poking around in the text message buffer, I found this message...




What a crackup! I mean, whats the odds that this would land in here on a piece of hardware sitting on my workbench? And, I wonder who Mr Taylor is?

 

Anyway, that should about cover all the big code bits that were needed to be added to what I already had, in order to get this thing running.