summaryrefslogtreecommitdiff
path: root/appl/cmd/ip/ppp/modem.m
blob: 9a99acf824a13ca131063e2d8ea8ad814323cb70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Modem: module
{
	PATH:	con "/dis/ip/ppp/modem.dis";

	ModemInfo: adt {
		path:			string;
		init:			string;
		country:		string;
		other:			string;
		errorcorrection:string;
		compression:	string;
		flowctl:		string;
		rateadjust:		string;
		mnponly:		string;
		dialtype:		string;
	};

	Device: adt {
		lock:	ref Lock->Semaphore;
		# modem stuff
		ctl:	ref Sys->FD;
		data:	ref Sys->FD;

		local:	string;
		remote:	string;
		status:	string;
		speed:	int;
		t:		ref ModemInfo;
		# input reader
		avail:	array of byte;
		pid:		int;
	};
	
	init:		fn(i: ref ModemInfo): ref Device;
	dial:		fn( m: ref Device, number: string);
	getc:		fn(m: ref Device, timout: int): int;
	getinput:	fn(m: ref Device, n: int ): array of byte;
	send:		fn(m: ref Device, x: string): int;
	close:	fn(m: ref Device): ref Sys->Connection;
	onhook:		fn(m: ref Device);
};