Skip to content

Commit

Permalink
fixed faulty parameter order for vscphlp_writeVscpDataToString
Browse files Browse the repository at this point in the history
  • Loading branch information
grodansparadis committed Jan 9, 2025
1 parent 8816fef commit a745a57
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
23 changes: 14 additions & 9 deletions linux/samples/bigtest/bigtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion linux/samples/example1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion linux/samples/send1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion linux/samples/send_periodic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 2 additions & 3 deletions src/vscphelperlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
extern "C" {
#endif


HELPERLIB_API long
vscphlp_newSession(void);
HELPERLIB_API void
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/simple/simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a745a57

Please sign in to comment.