C# SDK

◆ GpsSwitchOn()

static int GpsSwitchOn ( out SError  Error,
string  strPort,
Int32  BaudRate,
bool  bSwitchOn,
Int32  MaxTime 
)
inlinestatic

The function turns Drive GPS module ON and OFF.

Parameters
ErrorAdditional error information returned from Drive.
strPortName of port which is used to receive GPS signal.
BaudRateBaude rate used in GPS port.
bSwitchOnFlag determining whether GpsSwitchOn turns GPS module ON or OFF.
true - GpsSwitchOn turns GPS module ON.
false - GpsSwitchOn turns GPS module OFF.
MaxTimeMaximum time (in milliseconds) function can take. If MaxTime=0 function execution is not time limited.
Returns
1 if successful, other value otherwise.



Possible error codes returned from Drive are:

  • 0 - Function not succeeded.
  • 1 - Function succeeded.
  • 2 - Drive not succeeded.
  • 3 - Function reached timeout.



SError error;
string strPort = "COM5:";
int nBaudRate = 4800;
bool bSwitchOn = true;
int nMaxTime = 10000;
GpsSwitchOn(out error, strPort, nBaudRate, bSwitchOn, nMaxTime);

This code turns GPS module ON on COM5: port and sets baud rate to 4800;

References SError.SizeOf().