Specifications
AN93
Rev. 0.9 211
Example program in C/C++
This program shows how to establish an SDLC V29FastPOS link and keep the loop alive.
How to use the program:
It is only meant to run a few minutes for testing.
The program is run after a reset is done and loads the patch it loads from "patch.txt" and calls using the atdt line it
finds in "tel_no.txt". Both files need to terminate in CR LF.
The tel_no.txt file must contain a complete telephone number dialing line followed by a CR, e.g.
ATDT8,5551212.
// V29_test.cpp : Defines the entry point for the console application.
// Copyright 2005 Silicon Labs Inc. All rights reserved.
// Rev 0.0602
#include "stdafx.h"
#include "windows.h"
#include "stdlib.h"
#include <stdio.h>
#include <time.h>
char fnamePatch[]=".\\patch.txt";
char fnameTelno[]=".\\Tel_no.txt";
char *SendAndWaitFor(char *cpCommand, char *cpInBuffRd,
char *cpResponse, int iTimeoutMs);
char *WaitForResponse(char *cpResponse, char *cpInputBuffer,
int iTimeOutInMs);
void SetupSerPort(void);
void AssertRTS(bool bAssert);
void AssertDTR(bool bAssert);
void Delay(long iMs) ;
bool GetFileTextLine(char *cpIn);
void LoadAndSendPatch(void);
char *cpInBuffer;
char *cpOutBuffer;
char *cpInputWr;
char *cpErrorString;
FILE *hpPatchFile;
FILE *hpTelNoFile;
DCB dcb;
HANDLE hCom;
char *pcCommPort = "COM1";