Merge "Add USB serial port option. Uses kUSB for ALSR3"

This commit is contained in:
Brad Miller (WPI)
2014-12-14 07:05:52 -08:00
committed by Gerrit Code Review
3 changed files with 6 additions and 3 deletions

View File

@@ -13,8 +13,10 @@ void serialInitializePort(uint8_t port, int32_t *status) {
if(port == 0)
portName = "ASRL1::INSTR";
else
else if (port == 1)
portName = "ASRL2::INSTR";
else
portName = "ASRL3::INSTR";
*status = viOpen(m_resourceManagerHandle, const_cast<char*>(portName), VI_NULL, VI_NULL, (ViSession*)&m_portHandle[port]);
if(*status > 0)

View File

@@ -27,7 +27,7 @@ public:
enum StopBits {kStopBits_One=10, kStopBits_OnePointFive=15, kStopBits_Two=20};
enum FlowControl {kFlowControl_None=0, kFlowControl_XonXoff=1, kFlowControl_RtsCts=2, kFlowControl_DtrDsr=4};
enum WriteBufferMode {kFlushOnAccess=1, kFlushWhenFull=2};
enum Port {kOnboard=0, kMXP=1};
enum Port {kOnboard=0, kMXP=1, kUSB=2};
SerialPort(uint32_t baudRate, Port port = kOnboard, uint8_t dataBits = 8, Parity parity = kParity_None,
StopBits stopBits = kStopBits_One);

View File

@@ -36,7 +36,8 @@ public class SerialPort {
public enum Port {
kOnboard(0),
kMXP(1);
kMXP(1),
kUSB(2);
private int value;