![Datasat AP25 Скачать руководство пользователя страница 169](http://html2.mh-extra.com/html/datasat/ap25/ap25_installation-and-operating-manual_3699599169.webp)
AP25 Installation and Operating Guide
Version 1.00
Appendix H. Serial Command AP!
H-13
Document #: 9301H79500 Ver. 1.00
{
printf("connect() fail\n");
close( fd );
fd = -1;
return -1;
}
printf( "Connection to %s:%d OK\n", strAp20_IpAddress, AP20_PORT_NUM );
// Send passord only if AP20 has Setup Password defined
char StrAuth[100];
sprintf( StrAuth, "AUTH %s", StrPassword );
if( strlen( StrPassword ) )
{
Send( fd, StrAuth );
ReadResponse( fd, StrAuth );
if( !strcmp( rxBuf, "SETUP" ) )
{
printf( "Wrong Password\n" );
return( -1 );
}
else
printf( "Password OK\n" );
}
Send( fd, StrCmd );
ReadResponse( fd, StrCmd );
close( fd ); // Close connection
fd = -1;
return( 0 );
}
/* ------------------------------------------------------------------------ **
* Function: Send
*
* Sends a command string the AP20.
* ------------------------------------------------------------------------ */
int Send( int fd , char *StrCmd )
{
char strAP20Cmd[1024];
// Command starts with '@' and ends with CR
strcpy( strAP20Cmd, "@" );
strcat( strAP20Cmd, StrCmd );
strcat( strAP20Cmd, "\r" );
printf( "Sending NetCmd to AP20: %s\n", strAP20Cmd );
int ret = write(fd,&strAP20Cmd,strlen(strAP20Cmd) );
if ( ret < 0 )
{
fprintf(stderr,"write fail\n");
close(fd);
fd = -1;
}
return 0;
}
/* ------------------------------------------------------------------------ **
* Function: ReadResponse
*
* Reads data received from the AP20 until CR is received.
* ------------------------------------------------------------------------ */
int ReadResponse( int fd , char *StrCmd )
{
char c;
Содержание AP25
Страница 46: ...AP25 Installation and Operating Guide Page 46 AP25 Installation Operating Guide Document 9301H79500 Ver 1 00...
Страница 47: ...AP25 Installation and Operating Guide Page 47 AP25 Installation Operating Guide Document 9301H79500 Ver 1 00...
Страница 48: ...AP25 Installation and Operating Guide Page 48 AP25 Installation Operating Guide Document 9301H79500 Ver 1 00...
Страница 49: ...AP25 Installation and Operating Guide Page 49 AP25 Installation Operating Guide Document 9301H79500 Ver 1 00...
Страница 50: ...AP25 Installation and Operating Guide Page 50 AP25 Installation Operating Guide Document 9301H79500 Ver 1 00...
Страница 122: ...AP25 Installation and Operating Guide Version 1 00 Appendix B Interface Wiring Diagrams B 2 Document 9301H79500 Ver 1 00...
Страница 123: ...AP25 Installation and Operating Guide Version 1 00 Appendix B Interface Wiring Diagrams B 3 Document 9301H79500 Ver 1 00...
Страница 124: ...AP25 Installation and Operating Guide Version 1 00 Appendix B Interface Wiring Diagrams B 4 Document 9301H79500 Ver 1 00...
Страница 125: ...AP25 Installation and Operating Guide Version 1 00 Appendix B Interface Wiring Diagrams B 5 Document 9301H79500 Ver 1 00...
Страница 126: ...AP25 Installation and Operating Guide Version 1 00 Appendix B Interface Wiring Diagrams B 6 Document 9301H79500 Ver 1 00...
Страница 127: ...AP25 Installation and Operating Guide Version 1 00 Appendix B Interface Wiring Diagrams B 7 Document 9301H79500 Ver 1 00...
Страница 128: ...AP25 Installation and Operating Guide Version 1 00 Appendix B Interface Wiring Diagrams B 8 Document 9301H79500 Ver 1 00...