[En-Nut-Discussion] HDLC in charcter mode?
Hendrik Osenberg
hendrik.osenberg at web.de
Mon Apr 11 20:17:54 CEST 2011
Hello everyone,
i have a problem with the AT91 AHDLC Driver.
At first i want to use it as a normal uart in order to configure a bluetooth-module by sending hex-values. After receiving the correct answers, I want to start a PPP-session...
I have a working PPP-Connection and i can send Data from my board, by the way it is an OLIMEX SAM7-EX256, via a mobile phone. But to do this i have set up the bluetooth connection with another program which makes use of the normal uart1-driver. After this was successful i have to flash the board with the Code which I use the Ahdlc1 driver. In two older threads I read about _ioctl(pppcom, HDLC_SETIFNET, 0);, but this does not work. If I try to change in raw mode it ends up in a freezing CPU.
Here is a part of the example:
int pppcom;
unsigned long baud = 9600;
char transparent[] = {0x02,0x52,0x01,0x00,0x64,0x01,0x03};
int lctl = 1000;
NutRegisterDevice(&devAhdlc1, 0, 0);
NutRegisterDevice(&devPpp, 0, 0);
_ioctl(_fileno(stdout), UART_SETSPEED, &baud);
pppcom= _open("ppp:uart1/user/pass",_O_RDWR | _O_BINARY);
if (pppcom <= 0)
{
printf("failed\n");
while(1);
}
printf("done\n");
_ioctl(pppcom, UART_SETSPEED, &baud);
_ioctl(pppcom, UART_SETREADTIMEOUT, &lctl);
_ioctl(pppcom, HDLC_SETIFNET, 0);
fputc(transparent[2],pppcom);
Does this feature misses in this driver? But in which way is NutChat working? It is in character mode too, isn't it?
What am I doing wrong? Are there any hints?
Any help is welcome!
Greetings
Hendrik
___________________________________________________________
Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die
Toolbar eingebaut! http://produkte.web.de/go/toolbar
More information about the En-Nut-Discussion
mailing list