Example #1
0
BOOL devIsCondor(PDeviceDescriptor_t d)
{
  BOOL result = FALSE;

  LockComm();
  if ((d != NULL) && (d->IsCondor != NULL))
    result = d->IsCondor(d);
  UnlockComm();

  return result;
}
Example #2
0
// Only called from devInit() above which
// is in turn called with LockComm
BOOL devOpen(PDeviceDescriptor_t d, int Port){
  BOOL res = TRUE;

  if (d != NULL && d->Open != NULL)
    res = d->Open(d, Port);

  if (res == TRUE)
    d->Port = Port;

  return res;
}
Example #3
0
BOOL devIsBaroSource(PDeviceDescriptor_t d)
{
  BOOL result = FALSE;

  LockComm();
  if ((d != NULL) && (d->IsBaroSource != NULL))
    result = d->IsBaroSource(d);
  UnlockComm();

  return result;
}
Example #4
0
BOOL devPutFreqStandby(PDeviceDescriptor_t d, double Freq)
{
  BOOL result = TRUE;

  if (SIMMODE)
    return TRUE;
  LockComm();
  if (d != NULL && d->PutFreqStandby != NULL)
    result = d->PutFreqStandby(d, Freq);
  UnlockComm();

  return result;
}
Example #5
0
BOOL devPutVolume(PDeviceDescriptor_t d, int Volume)
{
  BOOL result = TRUE;

  if (SIMMODE)
    return TRUE;
  LockComm();
  if (d != NULL && d->PutVolume != NULL)
    result = d->PutVolume(d, Volume);
  UnlockComm();

  return result;
}
Example #6
0
BOOL devPutBallast(PDeviceDescriptor_t d, double Ballast)
{
  BOOL result = TRUE;

  if (SIMMODE)
    return TRUE;
  LockComm();
  if (d != NULL && d->PutBallast != NULL)
    result = d->PutBallast(d, Ballast);
  UnlockComm();

  return result;
}
Example #7
0
BOOL devPutBugs(PDeviceDescriptor_t d, double Bugs)
{
  BOOL result = TRUE;

  if (SIMMODE)
    return TRUE;
  LockComm();
  if (d != NULL && d->PutBugs != NULL)
    result = d->PutBugs(d, Bugs);
  UnlockComm();

  return result;
}
Example #8
0
BOOL devPutMacCready(PDeviceDescriptor_t d, double MacCready)
{
  BOOL result = TRUE;

  if (SIMMODE)
    return TRUE;
  LockComm();
  if (d != NULL && d->PutMacCready != NULL)
    result = d->PutMacCready(d, MacCready);
  UnlockComm();

  return result;
}
Example #9
0
BOOL devDirectLink(PDeviceDescriptor_t d,	BOOL bLinkEnable)
{
  BOOL result = TRUE;

  if (SIMMODE)
	return TRUE;

  if (d != NULL && d->DirectLink != NULL)
	result = d->DirectLink(d, bLinkEnable);


  return result;
}
Example #10
0
BOOL devIsLogger(PDeviceDescriptor_t d)
{
  bool result = false;

  LockComm();
  if ((d != NULL) && (d->IsLogger != NULL)) {
    if (d->IsLogger(d)) {
      result = true;
    }
  }
  if ((d != NULL) && !result) {
    result |= NMEAParser::PortIsFlarm(d->Port);
  }
  UnlockComm();

  return result;
}
Example #11
0
// Tear down methods should always succeed.
// Called from devInit() above under LockComm
// Also called when shutting down via devCloseAll()
BOOL devClose(PDeviceDescriptor_t d)
{
  if (d != NULL) {
    if (d->Close != NULL)
      d->Close(d);

    ComPort *Com = d->Com;
    d->Com = NULL;

    if (Com) {
      Com->Close();
      delete Com;
    }
  }

  return TRUE;
}
Example #12
0
// Tear down methods should always succeed.
// Called from devInit() above under LockComm
// Also called when shutting down via devCloseAll()
BOOL devClose(PDeviceDescriptor_t d)
{
  if (d != NULL) {
    if (d->Close != NULL) {
      d->Close(d);
    }
    
    ComPort *Com = d->Com;
    if (Com) {
      Com->Close();
      d->Com = NULL; // if we do that before Stop RXThread , Crash ....
      delete Com;
    }    
  }

  return TRUE;
}
Example #13
0
BOOL devDeclare(PDeviceDescriptor_t d, Declaration_t *decl, unsigned errBufferLen, TCHAR errBuffer[])
{
  BOOL result = FALSE;

  if (SIMMODE)
    return TRUE;
  
  const unsigned BUFF_LEN = 128;
  TCHAR buffer[BUFF_LEN];

  // We must be sure we are not going to attempt task declaration
  // while a port reset is already in progress. If this happens, a Flarm device will not be Flarm anymore
  // until a Flarm nmea sentence is parsed again once. 
  
  // LKTOKEN  _@M1400_ = "Task declaration"
  // LKTOKEN  _@M571_ = "START"
  _sntprintf(buffer, BUFF_LEN, _T("%s: %s..."), gettext(_T("_@M1400_")), gettext(_T("_@M571_")));
  CreateProgressDialog(buffer);

  /***********************************************************/
  devDirectLink(d,true);
  /***********************************************************/
  LockComm();

  if ((d != NULL) && (d->Declare != NULL))
	result = d->Declare(d, decl, errBufferLen, errBuffer);
  else {
	if ((d != NULL) && NMEAParser::PortIsFlarm(d->Port)) {
		result |= FlarmDeclare(d, decl, errBufferLen, errBuffer);
	}
  }


  UnlockComm();
  /***********************************************************/
  devDirectLink(d,false);
  /***********************************************************/
  CloseProgressDialog();
  
  return result;
}
Example #14
0
BOOL devLinkTimeout(PDeviceDescriptor_t d)
{
  BOOL result = FALSE;

  if (SIMMODE)
    return TRUE;
  LockComm();
  if (d == NULL){
    for (int i=0; i<NUMDEV; i++){
      d = &DeviceList[i];
      if (d->LinkTimeout != NULL)
        (d->LinkTimeout)(d);
    }
    result = TRUE;
  } else {
    if (d->LinkTimeout != NULL)
      result = d->LinkTimeout(d);
  }
  UnlockComm();

  return result;
}