You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I'm really sorry for the noise as I'm sure this is completely user error (demo project works fine) but I'm having a strange issue and you're probably going to know what's wrong right away.
The first time I open the port it works fine but if I close it and open it again I'm getting double the data. If I do this again, I get triple data, etc, etc. Almost as if a callback is being set over and over again but never unset. I can't seem to find where this happens in my code.
This is how I'm opening the port:
@IBActionfunc recordToggle(sender:AnyObject){
guard let port = serialPort else{return}letdescriptor=ORSSerialPacketDescriptor(prefixString:"{", suffixString:"}", maximumPacketLength:150, userInfo:nil)
switch recordButton.state {case NSOffState:print("Closing serial port \(port)")
port.stopListeningForPacketsMatchingDescriptor(descriptor)
port.close()case NSOnState:print("Opening serial port \(port)")
port.startListeningForPacketsMatchingDescriptor(descriptor)
port.open()default:
break
}}
The text was updated successfully, but these errors were encountered:
Hey, I'm really sorry for the noise as I'm sure this is completely user error (demo project works fine) but I'm having a strange issue and you're probably going to know what's wrong right away.
The first time I open the port it works fine but if I close it and open it again I'm getting double the data. If I do this again, I get triple data, etc, etc. Almost as if a callback is being set over and over again but never unset. I can't seem to find where this happens in my code.
This is how I'm opening the port:
The text was updated successfully, but these errors were encountered: