[ Return to Downloads ]
YAC Software Developer's Kit
Copyright (C) 2002 Jensen Harris
This short but growing document should contain all the information you, as a software developer or power user, need to get started building YAC listeners or using YAC in your own solutions.
If something in this document is missing, unclear, or could be explained better, please let me know.
|Writing a YAC Listener|
Writing a YAC listener is pretty straightforward. This document assumes that you are using YAC 0.15 or higher on all of your computers or devices; previous versions used a somewhat different protocol that is not described here.
A YAC listener simply listens on TCP port 10629. Although this port can be configured on the server and every current listener, most people will probably use the default port. Still, if you want to make sure your listener works in all scenarios, it might be a good idea to let users choose a non-default port.
When a connection is received, a listener should copy all sent text into a buffer until one of two things happens:
At this point, the listener should close the connection and prepare to display the text on the screen.
YAC can send two kinds of text over the network: Caller ID information, and <=300 character text messages. It is your job to determine what kind of message has been sent and to format it correctly.
A typical Caller ID buffer looks like this: @CALLBush George W.~(212) 555-9384\0
The tag @CALL precedes the Caller ID information. After this tag is the name of the caller and the formatted number, separated by a tilde (~). If either the name or number is not available, that string is omitted, but the tilde will still be present. The listener should strip off the @CALL tag, separate the name and number into separate parts, and display the information in a friendly way to the user. YAC takes care of formatting the name and number to the user's specification before encoding them for the network. Listeners should not assume that the name or number will come in a specific format or be of a specific length (other than that the whole string will be <= 300 characters.)
If the text buffer does not contain both the @CALL tag and a tilde (~), it should not be interpreted as Caller ID information. Instead, this message is a free-text buffer and contains no formatting. For instance, if you send a text message from YAC that says: "Meet me for dinner at 8.", the network buffer will look like this:
Meet me for dinner at 8.\0
As you can see, simple text messages are pretty straightforward. When you receive a text message, you should display the whole message to the user, word wrapping but maintaining line breaks if possible.
In all YAC network traffic, line breaks are sent as CRLF (\r\n), which is the Windows standard. On some operating systems and devices, you might need to remove the carriage returns in order to format the text correctly.
That's all there is to it!
|Programmatically Sending Text Messages With YAC|
There are several ways to send text messages using YAC. In all cases, YAC can send up to 300 characters of text to all listeners on the network (assuming that they are running version 0.15 or later.)
Last updated: Sunday, 10 August 2003 05:18 AM