Macros | Functions | Variables
test6.c File Reference
#include "MQTTAsync.h"
#include <string.h>
#include <stdlib.h>
#include <sys/time.h>
#include <unistd.h>
#include <signal.h>
#include <stdarg.h>
#include <time.h>
#include <sys/timeb.h>
Include dependency graph for test6.c:

Go to the source code of this file.

Macros

#define LOGA_ALWAYS   1
 
#define LOGA_DEBUG   0
 
#define LOGA_INFO   2
 
#define START_TIME_TYPE   struct timeval
 

Functions

void client_onCleaned (void *context, MQTTAsync_successData *response)
 
void client_onCleanedDisconnected (void *context, MQTTAsync_successData *response)
 
void client_onConnect (void *context, MQTTAsync_successData *response)
 
void client_onFailure (void *context, MQTTAsync_failureData *response)
 
void client_onReconnect (void *context, MQTTAsync_successData *response)
 
void client_onReconnectFailure (void *context, MQTTAsync_failureData *response)
 
void client_onSubscribe (void *context, MQTTAsync_successData *response)
 
void connectionLost (void *context, char *cause)
 
void control_connectionLost (void *context, char *cause)
 
int control_messageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *m)
 
void control_onConnect (void *context, MQTTAsync_successData *response)
 
void control_onFailure (void *context, MQTTAsync_failureData *response)
 
void control_onSubscribe (void *context, MQTTAsync_successData *response)
 
int control_send (char *message)
 
int control_wait (char *message)
 
int control_which (char *message1, char *message2)
 
long elapsed (START_TIME_TYPE start_time)
 
void getopts (int argc, char **argv)
 
int main (int argc, char **argv)
 
int messageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *m)
 
void messageSent (void *context, MQTTAsync_successData *response)
 
void MyLog (int LOGA_level, char *format,...)
 
void MySleep (long milliseconds)
 
void one_iteration (void)
 
int recreateReconnect (void)
 
int sendAndReceive (void)
 
START_TIME_TYPE start_clock (void)
 
int success (int count)
 
void trace_callback (enum MQTTASYNC_TRACE_LEVELS level, char *message)
 
void usage (void)
 
int waitForCompletion (START_TIME_TYPE start_time)
 

Variables

int arrivedCount = 0
 
MQTTAsync client
 
int client_cleaned = 0
 
static int client_subscribed = 0
 
MQTTAsync_connectOptions conn_opts = MQTTAsync_connectOptions_initializer
 
int connection_lost = 0
 
MQTTAsync control_client
 
int control_found = 0
 
static int control_subscribed = 0
 
int errors = 0
 
int expectedCount = 0
 
START_TIME_TYPE global_start_time
 
long last_completion_time = -1
 
int measuring = 0
 
int messagesSent = 0
 
struct {
   char *   clientid
 
   char *   connection
 
   int   connection_count
 
   char **   connections
 
   char *   control_connection
 
   char *   control_topic
 
   char *   password
 
   int   persistence
 
   int   qos
 
   int   retained
 
   int   slot_no
 
   char *   topic
 
   char *   username
 
   int   verbose
 
opts
 
static char pub_topic [200]
 
int recreated = 0
 
long roundtrip_time = 0L
 
int stopping = 0
 
static char sub_topic [200]
 
int test_count = 1000
 
char * wait_message = NULL
 
char * wait_message2 = NULL
 

Detailed Description

Async C client program for the MQTT v3 restart/recovery test suite.

Definition in file test6.c.

Macro Definition Documentation

#define LOGA_ALWAYS   1

Definition at line 171 of file test6.c.

#define LOGA_DEBUG   0

Definition at line 170 of file test6.c.

#define LOGA_INFO   2

Definition at line 172 of file test6.c.

#define START_TIME_TYPE   struct timeval

Definition at line 238 of file test6.c.

Function Documentation

void client_onCleaned ( void *  context,
MQTTAsync_successData response 
)

Definition at line 798 of file test6.c.

void client_onCleanedDisconnected ( void *  context,
MQTTAsync_successData response 
)

Definition at line 792 of file test6.c.

void client_onConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 772 of file test6.c.

void client_onFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 763 of file test6.c.

void client_onReconnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 444 of file test6.c.

void client_onReconnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 452 of file test6.c.

void client_onSubscribe ( void *  context,
MQTTAsync_successData response 
)

Definition at line 754 of file test6.c.

void connectionLost ( void *  context,
char *  cause 
)

Definition at line 475 of file test6.c.

void control_connectionLost ( void *  context,
char *  cause 
)

Definition at line 293 of file test6.c.

int control_messageArrived ( void *  context,
char *  topicName,
int  topicLen,
MQTTAsync_message m 
)

Callback which receives messages from the control connection

Parameters
context
topicNamethe name of the topic on which the message is received
topicLenthe length of the topic name (in case of embedded nulls)
mpointer to the message received
Returns
boolean

Definition at line 308 of file test6.c.

void control_onConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 943 of file test6.c.

void control_onFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 935 of file test6.c.

void control_onSubscribe ( void *  context,
MQTTAsync_successData response 
)

Definition at line 925 of file test6.c.

int control_send ( char *  message)

Definition at line 338 of file test6.c.

int control_wait ( char *  message)

Definition at line 355 of file test6.c.

int control_which ( char *  message1,
char *  message2 
)

Definition at line 383 of file test6.c.

long elapsed ( START_TIME_TYPE  start_time)

Definition at line 264 of file test6.c.

void getopts ( int  argc,
char **  argv 
)

Definition at line 80 of file test6.c.

int main ( int  argc,
char **  argv 
)

Definition at line 968 of file test6.c.

int messageArrived ( void *  context,
char *  topicName,
int  topicLen,
MQTTAsync_message m 
)

Definition at line 402 of file test6.c.

void messageSent ( void *  context,
MQTTAsync_successData response 
)

Definition at line 632 of file test6.c.

void MyLog ( int  LOGA_level,
char *  format,
  ... 
)

Definition at line 176 of file test6.c.

void MySleep ( long  milliseconds)

Definition at line 213 of file test6.c.

void one_iteration ( void  )

Definition at line 638 of file test6.c.

int recreateReconnect ( void  )

Definition at line 517 of file test6.c.

int sendAndReceive ( void  )

Definition at line 816 of file test6.c.

START_TIME_TYPE start_clock ( void  )

Definition at line 240 of file test6.c.

int success ( int  count)

Definition at line 567 of file test6.c.

void trace_callback ( enum MQTTASYNC_TRACE_LEVELS  level,
char *  message 
)

Definition at line 962 of file test6.c.

void usage ( void  )

Definition at line 37 of file test6.c.

int waitForCompletion ( START_TIME_TYPE  start_time)

Definition at line 595 of file test6.c.

Variable Documentation

int arrivedCount = 0

Definition at line 277 of file test6.c.

MQTTAsync client

Definition at line 276 of file test6.c.

int client_cleaned = 0

Definition at line 285 of file test6.c.

int client_subscribed = 0
static

Definition at line 752 of file test6.c.

char* clientid

Definition at line 54 of file test6.c.

Definition at line 275 of file test6.c.

char* connection

connection to system under test.

Definition at line 48 of file test6.c.

int connection_count

Definition at line 50 of file test6.c.

int connection_lost = 0

Definition at line 283 of file test6.c.

char** connections

HA connection list

Definition at line 49 of file test6.c.

MQTTAsync control_client

Definition at line 274 of file test6.c.

char* control_connection

MQTT control connection, for test sync

Definition at line 51 of file test6.c.

int control_found = 0

Definition at line 289 of file test6.c.

int control_subscribed = 0
static

Definition at line 923 of file test6.c.

char* control_topic

Definition at line 53 of file test6.c.

int errors = 0

Definition at line 281 of file test6.c.

int expectedCount = 0

Definition at line 278 of file test6.c.

START_TIME_TYPE global_start_time

Definition at line 400 of file test6.c.

long last_completion_time = -1

Definition at line 290 of file test6.c.

int measuring = 0

Definition at line 279 of file test6.c.

int messagesSent = 0

Definition at line 630 of file test6.c.

struct { ... } opts
Initial value:
=
{
"tcp://localhost:1884",
NULL,
0,
"tcp://localhost:7777",
"Eclipse/Paho/restart_test",
"Eclipse/Paho/restart_test/control",
"C_broken_client",
1,
2,
0,
NULL,
NULL,
0,
0,
}
char* password

Definition at line 59 of file test6.c.

int persistence

Definition at line 61 of file test6.c.

char pub_topic[200]
static

Definition at line 43 of file test6.c.

int qos

Definition at line 56 of file test6.c.

int recreated = 0

Definition at line 284 of file test6.c.

int retained

Definition at line 57 of file test6.c.

long roundtrip_time = 0L

Definition at line 280 of file test6.c.

int slot_no

Definition at line 55 of file test6.c.

int stopping = 0

Definition at line 282 of file test6.c.

char sub_topic[200]
static

Definition at line 44 of file test6.c.

int test_count = 1000

Definition at line 291 of file test6.c.

char* topic

Definition at line 52 of file test6.c.

char* username

Definition at line 58 of file test6.c.

int verbose

Definition at line 60 of file test6.c.

char* wait_message = NULL

Definition at line 287 of file test6.c.

char* wait_message2 = NULL

Definition at line 288 of file test6.c.



plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 04:02:49