Join/Login

Business Software

Open Source Software

For Vendors

Blog

About

More

Articles

Create

SourceForge Podcast

Site Documentation

Subscribe to our Newsletter

Support Request

For Vendors Help Create Join Login

Business Software

Open Source Software

SourceForge Podcast

Resources

Articles

Case Studies

Blog

Menu

Help

Create

Join

Login

Home

Browse

AMSerialPort

Code

AMSerialPort Code

Brought to you by: harmless-de

Summary

Files

Reviews

Support

Wiki

Code

Menu ▾ ▴

Browse Commits

Browse Files

[r36]: / trunk / SharedCode / AMSerialPort_Deprecated.m  Maximize  Restore  History

Download this file

183 lines (153 with data), 3.3 kB

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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182

//

// AMSerialPort_Deprecated.m

// AMSerialTest

//

// Created by Andreas on 26.07.06.

// Copyright 2006-2014 Andreas Mayer. All rights reserved.

//

#import "AMSerialPort_Deprecated.h"

#import "AMSerialPortAdditions.h"

@implementation AMSerialPort (Deprecated)

- (instancetype)init:(NSString *)path withName:(NSString *)name

{

return [self init:path withName:name type:@""];

}

// renamed to -options

- (NSDictionary *)getOptions

{

return [self options];

}

// renamed to -speed

- (unsigned long)getSpeed

{

return [self speed];

}

// renamed to -dataBits

- (int)getDataBits

{

return (int)[self dataBits];

}

// replaced by -parity

- (BOOL)testParity

{

// NO for "no parity"

return (options->c_cflag & PARENB) ? YES : NO;

}

// replaced by -parity

- (BOOL)testParityOdd

{

// meaningful only if TestParity == YES

return (options->c_cflag & PARODD) ? YES : NO;

}

// replaced by -setParity:

- (void)setParityNone

{

options->c_cflag &= ~PARENB;

}

// replaced by -setParity:

- (void)setParityEven

{

options->c_cflag |= PARENB;

options->c_cflag &= ~PARODD;

}

// replaced by -setParity:

- (void)setParityOdd

{

options->c_cflag |= PARENB;

options->c_cflag |= PARODD;

}

// renamed to -stopBits;

- (int)getStopBits

{

return [self stopBits];

}

// replaced by -setStopBits:

- (void)setStopBits2:(BOOL)two

{

// YES for 2 stop bits, NO for 1 stop bit

if (two) {

[self setStopBits:kAMSerialStopBitsTwo];

} else {

[self setStopBits:kAMSerialStopBitsOne];

}

}

// renamed to -echoEnabled

- (BOOL)testEchoEnabled

{

return [self echoEnabled];

}

// renamed to -RTSInputFlowControl

- (BOOL)testRTSInputFlowControl

{

return [self RTSInputFlowControl];

}

// renamed to -DTRInputFlowControl

- (BOOL)testDTRInputFlowControl

{

return [self DTRInputFlowControl];

}

// renamed to -CTSOutputFlowControl

- (BOOL)testCTSOutputFlowControl

{

return [self CTSOutputFlowControl];

}

// renamed to -DSROutputFlowControl

- (BOOL)testDSROutputFlowControl

{

return [self DSROutputFlowControl];

}

// renamed to -CAROutputFlowControl

- (BOOL)testCAROutputFlowControl

{

return [self CAROutputFlowControl];

}

// renamed to -hangupOnClose

- (BOOL)testHangupOnClose

{

return [self hangupOnClose];

}

// renamed to -localMode

- (BOOL)getLocal

{

return [self localMode];

}

// renamed to -setLocalMode:

- (void)setLocal:(BOOL)local

{

[self setLocalMode:local];

}

// renamed to -bytesAvailable

- (int)checkRead

{

return [self bytesAvailable];

}

// replaced by -readStringUsingEncoding:error:

- (NSString *)readString

{

return [self readStringUsingEncoding:NSMacOSRomanStringEncoding error:NULL];

}

// replaced by -readBytes:usingEncoding:error:

- (NSString *)readStringOfLength:(unsigned int)length

{

return [self readBytes:length usingEncoding:NSMacOSRomanStringEncoding error:NULL];

}

// replaced by -writeString:usingEncoding:error:

- (int)writeString:(NSString *)string

{

int result = 0;

NSError *error;

[self writeString:string usingEncoding:NSMacOSRomanStringEncoding error:&error];

if (error) {

NSDictionary *userInfo = [error userInfo];

if (userInfo) {

result = [[userInfo objectForKey:@"bytesWritten"] intValue];

}

}

return result;

}

// renamed to -flushInput:output:

- (BOOL)flushInput:(BOOL)fIn Output:(BOOL)fOut

{

return [self flushInput:fIn output:fOut];

}

@end

SourceForge

Create a Project

Open Source Software

Business Software

Top Downloaded Projects

Company

About

Team

SourceForge Headquarters
225 Broadway Suite 1600
San Diego, CA 92101
+1 (858) 422-6466

Resources

Support

Site Documentation

Site Status

SourceForge Reviews

© 2025 Slashdot Media. All Rights Reserved.

Terms Privacy Opt Out Advertise

×
Want the latest updates on software, tech news, and AI?

Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.

Submit