Skip to content

Commit

Permalink
Issue #86: Set RTS line in RequestResponeDemo apps. Fixes failure on …
Browse files Browse the repository at this point in the history
…10.11.
  • Loading branch information
Andrew Madsen committed Oct 4, 2015
1 parent 6fc0c9e commit 3dcaf14
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ - (void)setSerialPort:(ORSSerialPort *)serialPort

_serialPort.baudRate = @57600;
_serialPort.delegate = self;
_serialPort.RTS = YES;
[_serialPort open];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class SerialBoardController: NSObject, ORSSerialPortDelegate {
if let port = serialPort {
port.baudRate = 57600
port.delegate = self
port.RTS = true
port.open()
}
}
Expand Down
12 changes: 6 additions & 6 deletions Source/ORSSerialPortManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#if !__has_feature(objc_arc)
#error ORSSerialPortManager.m must be compiled with ARC. Either turn on ARC for the project or set the -fobjc-arc flag for ORSSerialPortManager.m in the Build Phases for this target
#error ORSSerialPortManager.m must be compiled with ARC. Either turn on ARC for the project or set the -fobjc-arc flag for ORSSerialPortManager.m in the Build Phases for this target
#endif

#import "ORSSerialPortManager.h"
Expand All @@ -40,9 +40,9 @@
#import <IOKit/serial/IOSerialKeys.h>

#ifdef LOG_SERIAL_PORT_ERRORS
#define LOG_SERIAL_PORT_ERROR(fmt, ...) NSLog(fmt, ##__VA_ARGS__)
#define LOG_SERIAL_PORT_ERROR(fmt, ...) NSLog(fmt, ##__VA_ARGS__)
#else
#define LOG_SERIAL_PORT_ERROR(fmt, ...)
#define LOG_SERIAL_PORT_ERROR(fmt, ...)
#endif

NSString * const ORSSerialPortsWereConnectedNotification = @"ORSSerialPortWasConnectedNotification";
Expand Down Expand Up @@ -136,10 +136,10 @@ - (void)registerForNotifications
#ifdef NSAppKitVersionNumber10_0
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
self.terminationObserver = [nc addObserverForName:NSApplicationWillTerminateNotification
object:nil
queue:nil
object:nil
queue:nil
usingBlock:^(NSNotification *notification){ terminationBlock(); }];

NSNotificationCenter *wsnc = [[NSWorkspace sharedWorkspace] notificationCenter];
[wsnc addObserver:self selector:@selector(systemWillSleep:) name:NSWorkspaceWillSleepNotification object:NULL];
[wsnc addObserver:self selector:@selector(systemDidWake:) name:NSWorkspaceDidWakeNotification object:NULL];
Expand Down

0 comments on commit 3dcaf14

Please sign in to comment.