diff --git a/linux/samples/bigtest/bigtest.c b/linux/samples/bigtest/bigtest.c index b85a91f..830c778 100644 --- a/linux/samples/bigtest/bigtest.c +++ b/linux/samples/bigtest/bigtest.c @@ -13,23 +13,23 @@ #define PASSWORD "secret" #define PORT 9598 -#define HOST "vscp2.vscp.org" +#define HOST "vscp1.vscp.org" //#define HOST "127.0.0.1" //#define HOST "192.168.1.7" //#define HOST "192.168.1.30" // pi4 -#define HOST_PLUS_PORT "tcp://vscp2.vscp.org:9598" +#define HOST_PLUS_PORT "tcp://vscp1.vscp.org:9598" //#define HOST_PLUS_PORT "127.0.0.1:9598" //#define HOST_PLUS_PORT "tcp://192.168.1.7:9598" //#define HOST_PLUS_PORT "tcp://192.168.1.30:9598" -#define INTERFACE "tcp://vscp2.vscp.org:9598;admin;secret" +#define INTERFACE "tcp://vscp1.vscp.org:9598;admin;secret" //#define INTERFACE "127.0.0.1:9598;admin;secret" //#define INTERFACE "tcp://192.168.1.7:9598;admin;secret" //#define INTERFACE "tcp://192.168.1.30:9598;admin;secret" // Count for number of events sent in burst -#define BURST_SEND_COUNT 200 +#define BURST_SEND_COUNT 2000 // If TEST_RECEIVE_LOOP is uncommented the rcvloop commands // will be tested. Must send five events externally to test @@ -1166,19 +1166,24 @@ int main(int argc, char* argv[]) vscphlp_deleteVSCPevent( pEventTo ); pEventTo = NULL; + pEvent = malloc( sizeof( vscpEvent ) ); + pEvent->pdata = (uint8_t *)malloc(4); + char dataBuf[80]; - if ( VSCP_ERROR_SUCCESS == vscphlp_writeVscpDataToString( pEvent, - dataBuf, + if ( VSCP_ERROR_SUCCESS == (rv = vscphlp_writeVscpDataToString( dataBuf, + pEvent, sizeof( dataBuf )-1, - 0 ) ) { + 0 ) ) ) { printf( "vscphlp_writeVscpDataToString: Success - \n%s \n", dataBuf ); } else { - printf( "vscphlp_writeVscpDataToString: Error: \n"); + printf( "vscphlp_writeVscpDataToString: Error: %d \n", rv); closeAll( handle1, handle2 ); return -1; } - + free( pEvent->pdata ); + pEvent->pdata = NULL; + vscphlp_deleteVSCPevent( pEvent ); unsigned char dataArray2[32]; unsigned short sizeData; diff --git a/linux/samples/example1.c b/linux/samples/example1.c index 9ea67b4..acc5a54 100644 --- a/linux/samples/example1.c +++ b/linux/samples/example1.c @@ -5,7 +5,7 @@ #include "vscphelperlib.h" #define HOST "vscp2.vscp.org:9598" -//#define HOST "demo.vscp.org:9598" +//#define HOST "vscp1.vscp.org:9598" //#define HOST "185.144.156.45:9598" //#define HOST "127.0.0.1:9598" diff --git a/linux/samples/send1.c b/linux/samples/send1.c index 104f060..72a43db 100644 --- a/linux/samples/send1.c +++ b/linux/samples/send1.c @@ -13,7 +13,7 @@ * */ -//#define HOST "demo.vscp.org:9598" +//#define HOST "vscp1.vscp.org:9598" //#define HOST "185.144.156.45:9598" //#define HOST "192.168.1.6:9598" #define HOST "127.0.0.1:9598" diff --git a/linux/samples/send_periodic.c b/linux/samples/send_periodic.c index a5f354b..de5c1b8 100644 --- a/linux/samples/send_periodic.c +++ b/linux/samples/send_periodic.c @@ -15,7 +15,7 @@ * */ -//#define HOST "demo.vscp.org:9598" +//#define HOST "vscp1.vscp.org:9598" //#define HOST "185.144.156.45:9598" #define HOST "192.168.1.6:9598" //#define HOST "127.0.0.1:9598" diff --git a/src/vscphelperlib.h b/src/vscphelperlib.h index ead3c07..d2efbe7 100644 --- a/src/vscphelperlib.h +++ b/src/vscphelperlib.h @@ -44,7 +44,6 @@ extern "C" { #endif - HELPERLIB_API long vscphlp_newSession(void); HELPERLIB_API void @@ -231,8 +230,8 @@ HELPERLIB_API int vscphlp_copyVSCPEvent( vscpEvent *pEventTo, const vscpEvent *pEventFrom ); HELPERLIB_API int -vscphlp_writeVscpDataToString( const vscpEvent *pEvent, - char *pstr, +vscphlp_writeVscpDataToString( char *pstr, + const vscpEvent *pEvent, size_t len, int bUseHtmlBreak ); HELPERLIB_API int diff --git a/test/simple/simple.c b/test/simple/simple.c index 7a522b0..350eef7 100644 --- a/test/simple/simple.c +++ b/test/simple/simple.c @@ -13,7 +13,7 @@ * */ -//#define HOST "demo.vscp.org:9598" +//#define HOST "vscp1.vscp.org:9598" //#define HOST "185.144.156.45:9598" #define HOST "192.168.1.7:9598" //#define HOST "127.0.0.1:9598"