CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

sending DTMF data, please help

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
runtime



Joined: 15 Sep 2003
Posts: 36

View user's profile Send private message

sending DTMF data, please help
PostPosted: Thu Jun 24, 2004 5:36 pm     Reply with quote

Hello all,

Suppose I want to send the following string of data over a phone line using DTMF tones:
{@ü*38]%<

The hex of each char will be:
7B 40 FC 2A 33 38 5D 25 3C

Using DTMF I can send the tones individually, 7-B-4-0-F-C...

Now, how do I separate each hex digit, i.e: to send digit 7B first i need to send tone 7 and then tone B?

Thank you in advance
Peter
Laurent Chouinard



Joined: 12 Sep 2003
Posts: 43

View user's profile Send private message

PostPosted: Fri Jun 25, 2004 10:44 am     Reply with quote

Suppose this:

int8 stuff;

//store 7b in some memory location
stuff = 7b;

//To send the left part:
output = stuff & 0xf0; //This will mask the "b" and keep the "7"
output = output >> 4; // This will shift the 7 from the high nibble to the low

send_dtmf(output); //first byte sent!

//To send the right part:
output = stuff & 0x0f;

send_dtmf(output); //second byte sent!

there you go.

Of course i'm assuming you have a function called "send_dtmf"... adjust for your needs.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group