@ -14,8 +14,9 @@
# include "hal_thread.h"
int main ( int argc , char * * argv ) {
int
main ( int argc , char * * argv )
{
char * hostname ;
int tcpPort = 102 ;
@ -46,25 +47,22 @@ int main(int argc, char** argv) {
/* use this to skip AP-Title completely - this may be required by some "obscure" servers */
// IsoConnectionParameters_setRemoteApTitle(parameters, NULL, 0);
// IsoConnectionParameters_setLocalApTitle(parameters, NULL, 0);
TSelector localTSelector = { 3 , { 0x00 , 0x01 , 0x02 } } ;
TSelector remoteTSelector = { 2 , { 0x00 , 0x01 } } ;
TSelector localTSelector = { 3 , { 0x00 , 0x01 , 0x02 } } ;
TSelector remoteTSelector = { 2 , { 0x00 , 0x01 } } ;
SSelector sSelector1 = { 2 , { 0 , 1 } } ;
SSelector sSelector2 = { 5 , { 0 , 1 , 2 , 3 , 4 } } ;
SSelector sSelector1 = { 2 , { 0 , 1 } } ;
SSelector sSelector2 = { 5 , { 0 , 1 , 2 , 3 , 4 } } ;
/* change parameters for presentation, session and transport layers */
IsoConnectionParameters_setRemoteAddresses ( parameters , 0x12345678 , sSelector1 , localTSelector ) ;
IsoConnectionParameters_setLocalAddresses ( parameters , 0x87654321 , sSelector2 , remoteTSelector ) ;
IsoConnectionParameters_setRemoteAddresses ( parameters , 0x12345678 , sSelector1 , localTSelector ) ;
IsoConnectionParameters_setLocalAddresses ( parameters , 0x87654321 , sSelector2 , remoteTSelector ) ;
char * password = " top secret " ;
/* use authentication */
AcseAuthenticationParameter auth = ( AcseAuthenticationParameter ) calloc ( 1 , sizeof ( struct sAcseAuthenticationParameter ) ) ;
auth - > mechanism = ACSE_AUTH_PASSWORD ;
auth - > value . password . octetString = ( uint8_t * ) password ;
auth - > value . password . passwordLength = strlen ( password ) ;
AcseAuthenticationParameter auth = AcseAuthenticationParameter_create ( ) ;
AcseAuthenticationParameter_setAuthMechanism ( auth , ACSE_AUTH_PASSWORD ) ;
AcseAuthenticationParameter_setPassword ( auth , password ) ;
IsoConnectionParameters_setAcseAuthenticationParameter ( parameters , auth ) ;
@ -84,6 +82,8 @@ int main(int argc, char** argv) {
}
IedConnection_destroy ( con ) ;
AcseAuthenticationParameter_destroy ( auth ) ;
}