1

I have question regarding Vx520 and PPP connection. I have to create PPP X.25 connection to my client, it requires Login and Password. I tried to set up PSTN connection (using ceStartDialIF functions for CE_COMM_TECH_DIALONLY device). It doesn't work with CE_COMM_TECH_PPPDIAL, besides there is no possibility to define username and password in CE_COMM_TECH_DIALONLY connection, in the CE_COMM_TECH_PPPDIAL there is no possibility to define phone number to my client. Please explain me how to implement PPP connection via PSTN that uses credentials and X.25 protocol. I know how to configure ETHERNET and GPRS, but it is very hard to create such connection via PSTN.

bytecode77
  • 14,163
  • 30
  • 110
  • 141

1 Answers1

0

Ok, I produced such code - is it ok to make PSTN/PPP connection?

    int iCount;
    int iBuffer;
    stNIInfo *pniInfo;
    unsigned int retLen;
    char chBuffer[50];

  // Register with CommEngine
  ceRegister();

  // Fetch number of Network Interfaces (NWIF)
  iCount = ceGetNWIFCount();

  // Allocate space
  pniInfo = new stNIInfo[niCount];

  // NWInfo
  ceGetNWIFInfo(pniInfo, niCount, &retLen);

  //Search for driver types and keep the handle 
  for (int z = 0; z < niCount; z++)
  {
    // uwaga: dla GPRS należy jeszcze sprawdzać comm technology
    if (pniInfo[z].niDeviceDriverType == CE_DRV_TYPE_PPP)
        iPPPHandle = pniInfo[z].niHandle;
  }

  //In the case of a string type:
  ceSetDDParamValue(iPPPHandle,INI_DIAL_PRIMARY,"002222229000",sizeof("002222229000"));
  ceGetDDParamValue(iPPPHandle, INI_DIAL_PRIMARY, sizeof(chBuffer), chBuffer, &retLen);

  stNI_PPPConfig pppCon;
  pppCon.ncAuthType = PPP_AUTH_PAP;
  strcpy(pppCon.ncUsername,"User1");
  strcpy(pppCon.ncPassword,"!21wsed@@");

  // set login & password for the PPP connection
  ceSetNWParamValue(iPPPHandle, "PPP_CONFIG", (const void *)&pppCon, sizeof(pppCon));

  //open network interface
  ceStartNWIF(iPPPHandle, CE_OPEN);