Lark.mesa
Copyright © 1984, 1986 by Xerox Corporation. All rights reserved.
Last modified by Swinehart and Owicki, December 7, 1982 1:47 pm
Last modified by Swinehart, May 25, 1986 9:57:29 pm PDT
Last modified by Stewart, July 18, 1983 12:58 pm
Data types for communications between Larks and their controlling servers. See LarkOps.mesa for Server -> Lark procedures, LarkSmarts.mesa for Lark -> Server procedures.
DIRECTORY
Pup USING [ Address, Net, Host ],
Rope USING [ ROPE ],
RPC USING [ Conversation, ShortROPE ],
Thrush USING [ KeyTable ]
;
Lark: CEDAR DEFINITIONS = {
-- *************************** Types ****************************** --
SHHH: TYPE = RPC.Conversation;
ROPE: TYPE = RPC.ShortROPE;
VoiceSocket: TYPE = Pup.Address;
Machine: TYPE = RECORD [
net: Pup.Net, host: Pup.Host];
noMachine: Machine = [[0], [0]];
Device: TYPE = MACHINE DEPENDENT {
microphonePTT (0), -- mike switch --
hookSwitch (1), -- switch on local handset
speakerSwitch (2), -- switch on speaker box --
touchPad (3), -- DTMF generator/detector (downstroke) --
keyboard (4), -- standard keyboard --
auxiliaryKeyboard (5), -- extra device
locator (6), -- as yet undefined --
ringDetect (7), -- on back door --
revertRelay (8), -- on Teleset, controls Tip, Ring, and receiver --
offHookRelay (9), -- on Telewall, controls Tip and Ring only --
sideTone (10), -- on Teleset --
ringEnable (11), -- volume bypass on speaker --
led (12), -- lamp on speaker box --
crossBar (13), -- analog crossbar switch --
timeslot (14), -- to set timeslots --
voiceMode (15), -- program modes --
inGain1 (16), -- table indicies --
inGain2 (17),
outGain1 (18),
outGain2 (19),
echoSuppression (20),
nothing (21),
clearCrosspoint (22), -- Event is row/column pair --
setCrosspoint (23), -- Event is row/column pair --
revertHookswitch (24), -- reverts A/A1, etc. --
aRelay (25), -- controls A/A1 --
tones (26), -- See description of notification in ToneSpec --
delay (27), -- Event is number of deciseconds to delay --
spMode (28), -- speakerphone mode --
touchPadUp (29), -- DTMF generator/detector (upstroke) --
keyboardUp (30), -- upstroke
auxiliaryKeyboardUp (31), -- upstroke
lastPlusOne (32), -- not used, but update when increasing number of devices.
(255) -- byte wide --
};
Kinds of keystrokes and other "digital" actions that a Lark user might initiate,
including keyboard and touchpad buttons, switch-hook actions, etc. An event must
be associated with a Device in order to be unambiguously interpreted.
Event: TYPE = CHARACTER;
Ascii range
firstChar: Event = '\000;
lastChar: Event = '\177;
DTMF pushbuttons
b0:  Event = '\200;
b1:  Event = '\201;
b2:  Event = '\202;
b3:  Event = '\203;
b4:  Event = '\204;
b5:  Event = '\205;
b6:  Event = '\206;
b7:  Event = '\207;
b8:  Event = '\210;
b9:  Event = '\211;
bA:  Event = '\212;
bB:  Event = '\213;
bC:  Event = '\214;
bD:  Event = '\215;
bStar:  Event = '\216;
bThorp: Event = '\217;
Switches (i.e., offhood, onhook)
enabled: Event = '\220;
disabled: Event = '\221;
reset:  Event = '\222;
Time slots
ts0:  Event = '\223;
ts12:  Event = '\224;
Table indices
tab0:  Event = '\225;
tab1:  Event = '\226;
tab2:  Event = '\227;
tab3:  Event = '\230;
tab4:  Event = '\231;
tab5:  Event = '\232;
tab6:  Event = '\233;
tab7:  Event = '\234;
tab8:  Event = '\235;
tab9:  Event = '\236;
Voice software modes
o3i1:  Event = '\237;
o2i2:  Event = '\240;
o1i1:  Event = '\241;
Echo suppression modes
inbound: Event = '\242;
outbound: Event = '\243;
<<TEMP: Synthesized telephone number terminator>>
endNum: Event = '\244;
tag field in Generate tones
notify: Event = '\245;
Typically, devices and events will be combined
CommandEvent: TYPE = MACHINE DEPENDENT RECORD [
device: Device,
event: Event
];
StatusEvent: TYPE = MACHINE DEPENDENT RECORD [
time: CARDINAL,
device: Device,
event: Event
];
Subset of events corresponding to "touch-tones"
DTMFEvent: TYPE = Event[b0..bThorp];
CharacterEvent: TYPE = Event[firstChar..lastChar];
Sequences have these kinds of domain types, so that instances of them will
fit in a single RPC packet.
Passel: TYPE = [0..32);
This is basically an Event "string", maxLength=length
Good for sending character sequence, as in the Display command, below.
StatusEvents: TYPE = REF StatusEventSequence;
StatusEventSequence: TYPE= RECORD[
e: PACKED SEQUENCE length: Passel OF StatusEvent
];
CommandEvents: TYPE = REF CommandEventSequence;
CommandEventSequence: TYPE= RECORD[
e: PACKED SEQUENCE length: Passel OF CommandEvent
];
Hertz: TYPE = [0..3500); -- Voice bandpass --
Milliseconds: TYPE = [0..10000);
There may be more than one way to transmit voice, depending.
We will probably also experiment with a number of encodings.
Protocol: TYPE = MACHINE DEPENDENT {interactive (0), nWay (1), recordOnly (2), (7)};
Encoding: TYPE = MACHINE DEPENDENT {muLaw (0), (7)}←muLaw;
VoiceBuffer: TYPE = MACHINE DEPENDENT {in1 (0), in2 (1), out1 (2), out2 (3), out3 (4), (7)};
If a Smarts says this to a Lark, it informs the Lark what connections
to establish (see Connect, below.) If a Lark says this to a Smarts, it
is a report of what connections presently exist.
ConnectionSpec: TYPE = REF ConnectionSpecRec;
ConnectionSpecRec: TYPE = MACHINE DEPENDENT RECORD [
protocol: Protocol,
encoding: Encoding,
blankA: [0..1777B] ← 0,
sampleRate: INTEGER,
packetSize: INTEGER,
blankB: [0..17777B] ← 0,
buffer: VoiceBuffer,
blankC: [0..7777B] ← 0,
keyIndex: [0..17B],
localSocket: VoiceSocket,
remoteSocket: VoiceSocket
];
Some more stuff that the Lark tells the Smarts when Registering.
Genre: TYPE = MACHINE DEPENDENT { Alto (0), Lark1(1), (255) };
LarkModel: TYPE = MACHINE DEPENDENT RECORD [
genre: Genre,
hardwareVersion: [0..256),
softwareVersion: CARDINAL
];
KeyTable: TYPE = Thrush.KeyTable;
EchoParameters: TYPE = REF EchoParameterRecord;
EchoParameterRecord: TYPE = MACHINE DEPENDENT RECORD [
blankA: [0..17777B] ← 0,
buffer: VoiceBuffer,
blankB: [0..37777B] ← 0,
buffer2Controlled: BOOL,
buffer1Controlled: BOOL,
decayTime: CARDINAL,
gain: ARRAY [0..5) OF CARDINAL
];
f1, f2: frequencies of two sinusoidal tones; f2 may be zero to request a single tone
on, off: noisy and silent intervals during each repetition.
repetitions: should be fairly small; longer sequences should be produced by queuing
multiple specifications, not too far ahead; prevents pollution after server crash.
waveTable, an index into Lark's available waveform tables for tone generation.
Also, more complex tone sequences can be specified using a queue of Tones requests.
queueIt: add specification to a list of sequential tone specs
~queueIt: supercede all pending tones with this one (e.g., scope=silence)
notify: issue a "tones" event when this entry terminates.
ToneSpec: TYPE = REF ToneSpecRec;
ToneSpecRec: TYPE = RECORD [
notification: CommandEvent ← [nothing, 0C], -- what to use when notifying.
If notification.device is 'nothing', ToneSpec is to be played only once.
volume: CARDINAL, -- "WaveTable": entire sequence played at one volume, for now
totalTime: CARDINAL, -- duration of one total performance in millisec
tones: LIST OF Tone
];
Notification: If notification.device is 'tones', notification will be reported as an event after completion of the first tone in the list.
totalTime field is not used by Lark. (ToneSpecs are used by other parts of the Etherphone system.)
Tone: TYPE = RECORD [
f1: CARDINAL, -- Hertz.
f2: CARDINAL, -- Hertz.
on, off: CARDINAL, -- Tone will be played at f2 Hz. for on ms.; then off ms. of silence.
repetitions: CARDINAL𡤁 -- specifies number of repetitions of this toned
];
Pause: not used by Lark.
}.
Stewart, May 25, 1986 9:57:29 pm PDT, added SetHostNumber, Stewart
Swinehart, May 25, 1986 9:57:14 pm PDT
Moved operations to LarkOps.
changes to: Machine