├── README.md ├── Sample ├── ANSIC.prg ├── Main.c ├── README.md ├── Sample.c ├── Variables.var └── heapsize.cpp ├── SampleNL ├── ANSIC.prg ├── Main.c ├── README.md ├── Sample.c ├── SecureSample.c ├── SecureSampleStayAlive.c ├── SecureSampleSubscribe.c ├── SecureSampleTestServer.c ├── Variables.var └── heapsize.cpp ├── SampleParam ├── ANSIC.prg ├── Main.c ├── Param.c ├── Param.h ├── README.md ├── Sample.c ├── Variables.var └── heapsize.cpp ├── img ├── add_lib.PNG ├── add_prog.PNG ├── compiler.PNG ├── enable_dns.PNG ├── file_device.PNG ├── headers.PNG ├── heapsize.PNG ├── lib_static.PNG ├── libs.PNG ├── linker_properties.PNG ├── logger.PNG ├── software.PNG ├── task_properties.PNG └── transfer_settings.PNG └── library ├── V4.26.0-rev.10 └── PahoMQTT │ └── V4.26.0 │ ├── Binary.lby │ ├── Clients.h │ ├── Constants.var │ ├── Heap.h │ ├── LinkedList.h │ ├── Log.h │ ├── MQTTClient.h │ ├── MQTTClientPersistence.h │ ├── MQTTPacket.h │ ├── MQTTPacketOut.h │ ├── MQTTPersistence.h │ ├── MQTTPersistenceDefault.h │ ├── MQTTProtocol.h │ ├── MQTTProtocolClient.h │ ├── MQTTProtocolOut.h │ ├── Messages.h │ ├── PahoMQTT.fun │ ├── SG3 │ └── PahoMQTT.h │ ├── SG4 │ ├── PahoMQTT.br │ ├── PahoMQTT.h │ ├── libPahoMQTT.a │ └── libPahoMQTT_s.a │ ├── SGC │ └── PahoMQTT.h │ ├── SSLSocket.h │ ├── Socket.h │ ├── SocketBuffer.h │ ├── StackTrace.h │ ├── Thread.h │ ├── Tree.h │ ├── Types.typ │ ├── VersionInfo.h │ ├── ar │ ├── IA32 │ │ ├── Package.pkg │ │ ├── libarsystem.a │ │ ├── liboSSLv110_s.a │ │ └── librtk_lib.a │ ├── Package.pkg │ └── logger.h │ └── utf-8.h ├── V4.26.0-rev.11 └── PahoMQTT │ └── V4.26.0 │ ├── Binary.lby │ ├── Clients.h │ ├── Constants.var │ ├── Heap.h │ ├── LinkedList.h │ ├── Log.h │ ├── MQTTClient.h │ ├── MQTTClientPersistence.h │ ├── MQTTPacket.h │ ├── MQTTPacketOut.h │ ├── MQTTPersistence.h │ ├── MQTTPersistenceDefault.h │ ├── MQTTProtocol.h │ ├── MQTTProtocolClient.h │ ├── MQTTProtocolOut.h │ ├── Messages.h │ ├── PahoMQTT.fun │ ├── SG3 │ └── PahoMQTT.h │ ├── SG4 │ ├── PahoMQTT.br │ ├── PahoMQTT.h │ ├── libPahoMQTT.a │ └── libPahoMQTT_s.a │ ├── SGC │ └── PahoMQTT.h │ ├── SSLSocket.h │ ├── Socket.h │ ├── SocketBuffer.h │ ├── StackTrace.h │ ├── Thread.h │ ├── Tree.h │ ├── Types.typ │ ├── VersionInfo.h │ ├── ar │ ├── IA32 │ │ ├── Package.pkg │ │ ├── libarsystem.a │ │ ├── liboSSLv110_s.a │ │ └── librtk_lib.a │ ├── Package.pkg │ └── logger.h │ └── utf-8.h ├── V4.34.0-rev.10 └── PahoMQTT │ └── V4.34.0 │ ├── Binary.lby │ ├── Clients.h │ ├── Constants.var │ ├── Heap.h │ ├── LinkedList.h │ ├── Log.h │ ├── MQTTClient.h │ ├── MQTTClientPersistence.h │ ├── MQTTPacket.h │ ├── MQTTPacketOut.h │ ├── MQTTPersistence.h │ ├── MQTTPersistenceDefault.h │ ├── MQTTProtocol.h │ ├── MQTTProtocolClient.h │ ├── MQTTProtocolOut.h │ ├── Messages.h │ ├── PahoMQTT.fun │ ├── SG3 │ └── PahoMQTT.h │ ├── SG4 │ ├── Arm │ │ ├── PahoMQTT.br │ │ ├── libPahoMQTT.a │ │ └── libPahoMQTT_s.a │ ├── PahoMQTT.br │ ├── PahoMQTT.h │ ├── libPahoMQTT.a │ └── libPahoMQTT_s.a │ ├── SGC │ └── PahoMQTT.h │ ├── SSLSocket.h │ ├── Socket.h │ ├── SocketBuffer.h │ ├── StackTrace.h │ ├── Thread.h │ ├── Tree.h │ ├── Types.typ │ ├── VersionInfo.h │ ├── ar │ ├── ARM │ │ ├── Package.pkg │ │ ├── libarsystem.a │ │ ├── liboSSLv110_s.a │ │ └── librtk_lib.a │ ├── IA32 │ │ ├── Package.pkg │ │ ├── libarsystem.a │ │ ├── liboSSLv110_s.a │ │ └── librtk_lib.a │ ├── Package.pkg │ └── logger.h │ └── utf-8.h ├── V4.34.0-rev.11 └── PahoMQTT │ └── V4.34.0 │ ├── Binary.lby │ ├── Clients.h │ ├── Constants.var │ ├── Heap.h │ ├── LinkedList.h │ ├── Log.h │ ├── MQTTClient.h │ ├── MQTTClientPersistence.h │ ├── MQTTPacket.h │ ├── MQTTPacketOut.h │ ├── MQTTPersistence.h │ ├── MQTTPersistenceDefault.h │ ├── MQTTProtocol.h │ ├── MQTTProtocolClient.h │ ├── MQTTProtocolOut.h │ ├── Messages.h │ ├── PahoMQTT.fun │ ├── SG3 │ └── PahoMQTT.h │ ├── SG4 │ ├── Arm │ │ ├── PahoMQTT.br │ │ ├── libPahoMQTT.a │ │ └── libPahoMQTT_s.a │ ├── PahoMQTT.br │ ├── PahoMQTT.h │ ├── libPahoMQTT.a │ └── libPahoMQTT_s.a │ ├── SGC │ └── PahoMQTT.h │ ├── SSLSocket.h │ ├── Socket.h │ ├── SocketBuffer.h │ ├── StackTrace.h │ ├── Thread.h │ ├── Tree.h │ ├── Types.typ │ ├── VersionInfo.h │ ├── ar │ ├── ARM │ │ ├── Package.pkg │ │ ├── libarsystem.a │ │ ├── liboSSLv110_s.a │ │ └── librtk_lib.a │ ├── IA32 │ │ ├── Package.pkg │ │ ├── libarsystem.a │ │ ├── liboSSLv110_s.a │ │ └── librtk_lib.a │ ├── Package.pkg │ └── logger.h │ └── utf-8.h └── V4.45.0-rev.11 └── PahoMQTT └── V4.45.0 ├── Binary.lby ├── Clients.h ├── Constants.var ├── Heap.h ├── LinkedList.h ├── Log.h ├── MQTTClient.h ├── MQTTClientPersistence.h ├── MQTTPacket.h ├── MQTTPacketOut.h ├── MQTTPersistence.h ├── MQTTPersistenceDefault.h ├── MQTTProtocol.h ├── MQTTProtocolClient.h ├── MQTTProtocolOut.h ├── Messages.h ├── PahoMQTT.fun ├── SG3 └── PahoMQTT.h ├── SG4 ├── Arm │ ├── libPahoMQTT.a │ └── libPahoMQTT_s.a ├── PahoMQTT.br ├── PahoMQTT.h ├── libPahoMQTT.a └── libPahoMQTT_s.a ├── SGC └── PahoMQTT.h ├── SSLSocket.h ├── Socket.h ├── SocketBuffer.h ├── StackTrace.h ├── Thread.h ├── Tree.h ├── Types.typ ├── VersionInfo.h ├── ar ├── ARM │ ├── Package.pkg │ ├── libarsystem.a │ ├── liboSSLv110_s.a │ └── librtk_lib.a ├── IA32 │ ├── Package.pkg │ ├── libarsystem.a │ ├── liboSSLv110_s.a │ └── librtk_lib.a ├── Package.pkg └── logger.h └── utf-8.h /Sample/ANSIC.prg: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Main.c 6 | Sample.c 7 | Variables.var 8 | heapsize.cpp 9 | 10 | -------------------------------------------------------------------------------- /Sample/Main.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #ifdef _DEFAULT_INCLUDES 5 | #include 6 | #endif 7 | void sample(unsigned long param); 8 | 9 | void _INIT ProgramInit(void) 10 | { 11 | PahoMQTT_Init_0.EnableLogger = 1; 12 | PahoMQTT_Init_0.MainThread = (UDINT)sample; 13 | PahoMQTT_Init_0.ThreadParam = (UDINT)Message; 14 | PahoMQTT_Init_0.SuspendThread = 1; 15 | PahoMQTT_Init(&PahoMQTT_Init_0); 16 | } 17 | 18 | void _CYCLIC ProgramCyclic(void) 19 | { 20 | PahoMQTT_Cyclic(&PahoMQTT_Cyclic_0); 21 | } 22 | 23 | void _EXIT ProgramExit(void) 24 | { 25 | PahoMQTT_Exit(); 26 | } 27 | 28 | -------------------------------------------------------------------------------- /Sample/README.md: -------------------------------------------------------------------------------- 1 | ## Sample 2 | 3 | This is a very simple example that publishes a "Hello world!" message every 5 seconds. The message itself is a _LOCAL variable Message, so you can change what is published via the watch window. The topic and the IP address of the broker is defined in the Sample.c file. This sample currently doesnt handle a lost connection, see some of the [SampleNL](/SampleNL/) examples for that feature. 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Sample/Sample.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include "MQTTClient.h" 6 | #include "ar/logger.h" 7 | 8 | #define ADDRESS "tcp://192.168.1.162:1884" 9 | #define CLIENTID "ExampleClientPub" 10 | #define TOPIC "MQTT Examples" 11 | #define PAYLOAD message 12 | #define QOS 1 13 | #define TIMEOUT 10000L 14 | 15 | void sample(unsigned long param) 16 | { 17 | char *message = (char *)param; 18 | 19 | do 20 | { 21 | MQTTClient client; 22 | MQTTClient_connectOptions conn_opts = MQTTClient_connectOptions_initializer; 23 | MQTTClient_message pubmsg = MQTTClient_message_initializer; 24 | MQTTClient_deliveryToken token; 25 | int rc; 26 | MQTTClient_create(&client, ADDRESS, CLIENTID, 27 | MQTTCLIENT_PERSISTENCE_NONE, NULL); 28 | conn_opts.keepAliveInterval = 20; 29 | conn_opts.cleansession = 1; 30 | if ((rc = MQTTClient_connect(client, &conn_opts)) != MQTTCLIENT_SUCCESS) 31 | { 32 | ArPahoLogError("Failed to connect, return code %d\n", rc); 33 | } 34 | else 35 | { 36 | while(PahoMQTT_IsAlive()) 37 | { 38 | pubmsg.payload = PAYLOAD; 39 | pubmsg.payloadlen = strlen(PAYLOAD); 40 | pubmsg.qos = QOS; 41 | pubmsg.retained = 0; 42 | MQTTClient_publishMessage(client, TOPIC, &pubmsg, &token); 43 | ArPahoLogInfo("Waiting for up to %d seconds for publication of %s\n" 44 | "on topic %s for client with ClientID: %s\n", 45 | (int)(TIMEOUT/1000), PAYLOAD, TOPIC, CLIENTID); 46 | rc = MQTTClient_waitForCompletion(client, token, TIMEOUT); 47 | ArPahoLogSuccess("Message with delivery token %d delivered\n", token); 48 | 49 | PahoMQTT_Sleep(5000); 50 | } 51 | 52 | } 53 | MQTTClient_disconnect(client, 10000); 54 | MQTTClient_destroy(&client); 55 | 56 | } while(PahoMQTT_IsReset()); 57 | } 58 | -------------------------------------------------------------------------------- /Sample/Variables.var: -------------------------------------------------------------------------------- 1 | VAR 2 | PahoMQTT_Cyclic_0 : PahoMQTT_Cyclic; 3 | Message : STRING[80] := 'Hello World!'; 4 | PahoMQTT_Init_0 : PahoMQTT_Init; 5 | END_VAR 6 | -------------------------------------------------------------------------------- /Sample/heapsize.cpp: -------------------------------------------------------------------------------- 1 | unsigned long bur_heap_size = 1000000; 2 | -------------------------------------------------------------------------------- /SampleNL/ANSIC.prg: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Main.c 6 | Sample.c 7 | SecureSample.c 8 | SecureSampleStayAlive.c 9 | SecureSampleTestServer.c 10 | SecureSampleSubscribe.c 11 | Variables.var 12 | heapsize.cpp 13 | 14 | -------------------------------------------------------------------------------- /SampleNL/Main.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #ifdef _DEFAULT_INCLUDES 5 | #include 6 | #endif 7 | void sample(unsigned long param); 8 | void secureSample(unsigned long param); 9 | void secureSampleTestServer(unsigned long param); 10 | void secureSampleStayAlive(unsigned long param); 11 | 12 | void _INIT ProgramInit(void) 13 | { 14 | 15 | PahoMQTT_Init_0.EnableLogger = 1; 16 | PahoMQTT_Init_0.MainThread = (UDINT)secureSampleTestServer; 17 | PahoMQTT_Init_0.ThreadParam = (UDINT)Message; 18 | PahoMQTT_Init_0.SuspendThread = 1; 19 | PahoMQTT_Init(&PahoMQTT_Init_0); 20 | 21 | PahoMQTT_Cyclic_0.LoggerLevel = 4; 22 | } 23 | 24 | void _CYCLIC ProgramCyclic(void) 25 | { 26 | PahoMQTT_Cyclic(&PahoMQTT_Cyclic_0); 27 | } 28 | 29 | void _EXIT ProgramExit(void) 30 | { 31 | PahoMQTT_Exit(); 32 | } 33 | 34 | -------------------------------------------------------------------------------- /SampleNL/README.md: -------------------------------------------------------------------------------- 1 | ## SampleNL 2 | 3 | This is an enhancement of the Sample Task by @JobFranken where you can choose between four different threads 4 | 5 | void sample(unsigned long param); 6 | void secureSample(unsigned long param); 7 | void secureSampleTestServer(unsigned long param); 8 | void secureSampleStayAlive(unsigned long param); 9 | 10 | You select the which thread to run via the ProgramInit, for example 11 | 12 | PahoMQTT_Init_0.MainThread = (UDINT)secureSampleTestServer; 13 | 14 | Some short information: 15 | 16 | ### sample 17 | This is equivalent to the [Sample](/Sample/) task, just publishing a "hello world" message. This one currently doesnt handle a lost connection. 18 | 19 | ### secureSample 20 | Here we have added SSL to the connection to a local broker. This one currently doesnt handle a lost connection. 21 | 22 | ### secureSampleStayAlive 23 | Same as above, but the client reconnects at a lost connection. 24 | 25 | ### secureSampleTestServer 26 | Pretty much the same as the secureSampleStayAlive, but the connection is made to test.mosquitto.org instead. This is a useful test server and can be reached when the system is connected to the internet and DNS service is activated on the Controller. 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /SampleNL/Sample.c: -------------------------------------------------------------------------------- 1 | #ifdef _DEFAULT_INCLUDES 2 | #include 3 | #endif 4 | 5 | #include 6 | #include 7 | #include 8 | #include "MQTTClient.h" 9 | #include "ar/logger.h" 10 | 11 | #define ADDRESS "tcp://192.168.0.240:1883" 12 | #define CLIENTID "Sample" 13 | #define TOPIC "test" 14 | #define PAYLOAD message 15 | #define QOS 1 16 | #define TIMEOUT 10000L 17 | 18 | void sample(unsigned long param) 19 | { 20 | char *message = (char *)param; 21 | do 22 | { 23 | MQTTClient client; 24 | MQTTClient_connectOptions conn_opts = MQTTClient_connectOptions_initializer; 25 | MQTTClient_message pubmsg = MQTTClient_message_initializer; 26 | MQTTClient_deliveryToken token; 27 | int rc; 28 | MQTTClient_create(&client, ADDRESS, CLIENTID, 29 | MQTTCLIENT_PERSISTENCE_NONE, NULL); 30 | conn_opts.keepAliveInterval = 20; 31 | conn_opts.cleansession = 1; 32 | 33 | // conn_opts.username = "BuR"; 34 | // conn_opts.password = "BuR"; 35 | 36 | if ((rc = MQTTClient_connect(client, &conn_opts)) != MQTTCLIENT_SUCCESS) 37 | { 38 | ArPahoLogError("Failed to connect, return code %d\n", rc); 39 | } 40 | else 41 | { 42 | while(PahoMQTT_IsAlive()) 43 | { 44 | pubmsg.payload = PAYLOAD; 45 | pubmsg.payloadlen = strlen(PAYLOAD); 46 | pubmsg.qos = QOS; 47 | pubmsg.retained = 0; 48 | MQTTClient_publishMessage(client, TOPIC, &pubmsg, &token); 49 | ArPahoLogInfo("Waiting for up to %d seconds for publication of %s\n" 50 | "on topic %s for client with ClientID: %s\n", 51 | (int)(TIMEOUT/1000), PAYLOAD, TOPIC, CLIENTID); 52 | rc = MQTTClient_waitForCompletion(client, token, TIMEOUT); 53 | ArPahoLogSuccess("Message with delivery token %d delivered\n", token); 54 | 55 | PahoMQTT_Sleep(5000); 56 | } 57 | 58 | } 59 | MQTTClient_disconnect(client, 10000); 60 | MQTTClient_destroy(&client); 61 | 62 | } while(PahoMQTT_IsReset()); 63 | } 64 | -------------------------------------------------------------------------------- /SampleNL/SecureSample.c: -------------------------------------------------------------------------------- 1 | #ifdef _DEFAULT_INCLUDES 2 | #include 3 | #endif 4 | 5 | #include 6 | #include 7 | #include 8 | #include "MQTTClient.h" 9 | #include "ar/logger.h" 10 | 11 | #define ADDRESS "ssl://192.168.0.240:8883" 12 | #define CLIENTID "SecSample" 13 | #define TOPIC "test" 14 | #define PAYLOAD message 15 | #define QOS 1 16 | #define TIMEOUT 10000L 17 | 18 | void secureSample(unsigned long param) 19 | { 20 | char *message = (char *)param; 21 | 22 | do 23 | { 24 | MQTTClient client; 25 | MQTTClient_connectOptions conn_opts = MQTTClient_connectOptions_initializer; 26 | MQTTClient_message pubmsg = MQTTClient_message_initializer; 27 | MQTTClient_deliveryToken token; 28 | MQTTClient_SSLOptions ssl_opts = MQTTClient_SSLOptions_initializer; 29 | int rc = 0; 30 | 31 | 32 | 33 | rc = MQTTClient_create(&client, ADDRESS, CLIENTID, MQTTCLIENT_PERSISTENCE_NONE, NULL); 34 | 35 | conn_opts.keepAliveInterval = 20; 36 | conn_opts.reliable = 0; 37 | conn_opts.cleansession = 1; 38 | //conn_opts.username = "BuR"; 39 | //conn_opts.password = "BuR"; 40 | ssl_opts.enableServerCertAuth = 0; 41 | 42 | 43 | conn_opts.ssl = &ssl_opts; 44 | 45 | if ((rc = MQTTClient_connect(client, &conn_opts)) != MQTTCLIENT_SUCCESS) 46 | { 47 | ArPahoLogError("Failed to connect, return code %d\n", rc); 48 | } 49 | else 50 | { 51 | while(PahoMQTT_IsAlive()) 52 | { 53 | pubmsg.payload = PAYLOAD; 54 | pubmsg.payloadlen = strlen(PAYLOAD); 55 | pubmsg.qos = QOS; 56 | pubmsg.retained = 0; 57 | MQTTClient_publishMessage(client, TOPIC, &pubmsg, &token); 58 | ArPahoLogInfo("Waiting for up to %d seconds for publication of %s\n" 59 | "on topic %s for client with ClientID: %s\n", 60 | (int)(TIMEOUT/1000), PAYLOAD, TOPIC, CLIENTID); 61 | rc = MQTTClient_waitForCompletion(client, token, TIMEOUT); 62 | ArPahoLogSuccess("Message with delivery token %d delivered\n", token); 63 | 64 | PahoMQTT_Sleep(5000); 65 | } 66 | } 67 | MQTTClient_disconnect(client, 10000); 68 | MQTTClient_destroy(&client); 69 | 70 | } while(PahoMQTT_IsReset()); 71 | } 72 | -------------------------------------------------------------------------------- /SampleNL/SecureSampleStayAlive.c: -------------------------------------------------------------------------------- 1 | #ifdef _DEFAULT_INCLUDES 2 | #include 3 | #endif 4 | 5 | #include 6 | #include 7 | #include 8 | #include "MQTTClient.h" 9 | #include "ar/logger.h" 10 | 11 | #define ADDRESS "ssl://192.168.0.240:8883" 12 | #define CLIENTID "SecureSampleAlive" 13 | #define TOPIC "test" 14 | #define PAYLOAD message 15 | #define QOS 1 16 | #define TIMEOUT 10000L 17 | 18 | void secureSampleStayAlive(unsigned long param) 19 | { 20 | char *message = (char *)param; 21 | do 22 | { 23 | MQTTClient client; 24 | MQTTClient_connectOptions conn_opts = MQTTClient_connectOptions_initializer; 25 | MQTTClient_message pubmsg = MQTTClient_message_initializer; 26 | MQTTClient_deliveryToken token; 27 | MQTTClient_SSLOptions ssl_opts = MQTTClient_SSLOptions_initializer; 28 | int rc = 0; 29 | 30 | 31 | 32 | rc = MQTTClient_create(&client, ADDRESS, CLIENTID, MQTTCLIENT_PERSISTENCE_NONE, NULL); 33 | 34 | conn_opts.keepAliveInterval = 20; 35 | conn_opts.reliable = 0; 36 | conn_opts.cleansession = 1; 37 | //conn_opts.username = "BuR"; 38 | //conn_opts.password = "BuR"; 39 | ssl_opts.enableServerCertAuth = 0; 40 | 41 | conn_opts.ssl = &ssl_opts; 42 | 43 | while(PahoMQTT_IsAlive()) 44 | { 45 | 46 | if ((rc = MQTTClient_connect(client, &conn_opts)) != MQTTCLIENT_SUCCESS) 47 | { 48 | ArPahoLogError("Failed to connect, return code %d\n", rc); 49 | PahoMQTT_Sleep(5000); 50 | } 51 | else 52 | { 53 | while(MQTTClient_isConnected( client ) && PahoMQTT_IsAlive()) 54 | { 55 | pubmsg.payload = PAYLOAD; 56 | pubmsg.payloadlen = strlen(PAYLOAD); 57 | pubmsg.qos = QOS; 58 | pubmsg.retained = 0; 59 | MQTTClient_publishMessage(client, TOPIC, &pubmsg, &token); 60 | ArPahoLogInfo("Waiting for up to %d seconds for publication of %s\n" 61 | "on topic %s for client with ClientID: %s\n", 62 | (int)(TIMEOUT/1000), PAYLOAD, TOPIC, CLIENTID); 63 | rc = MQTTClient_waitForCompletion(client, token, TIMEOUT); 64 | ArPahoLogSuccess("Message with delivery token %d delivered\n", token); 65 | 66 | PahoMQTT_Sleep(5000); 67 | } 68 | } 69 | } 70 | MQTTClient_disconnect(client, 10000); 71 | MQTTClient_destroy(&client); 72 | } while(PahoMQTT_IsReset()); 73 | } 74 | -------------------------------------------------------------------------------- /SampleNL/SecureSampleSubscribe.c: -------------------------------------------------------------------------------- 1 | #ifdef _DEFAULT_INCLUDES 2 | #include 3 | #endif 4 | 5 | #include 6 | #include 7 | #include 8 | #include "MQTTClient.h" 9 | #include "ar/logger.h" 10 | 11 | #define ADDRESS "ssl://192.168.0.240:8883" 12 | #define CLIENTID "SubSample" 13 | #define TOPIC "test" 14 | #define PAYLOAD message 15 | #define QOS 1 16 | #define TIMEOUT 10000L 17 | 18 | void secureSampleSubscribe(unsigned long param) 19 | { 20 | do 21 | { 22 | MQTTClient client; 23 | MQTTClient_connectOptions conn_opts = MQTTClient_connectOptions_initializer; 24 | MQTTClient_message pubmsg = MQTTClient_message_initializer; 25 | MQTTClient_deliveryToken token; 26 | MQTTClient_SSLOptions ssl_opts = MQTTClient_SSLOptions_initializer; 27 | int rc = 0; 28 | 29 | rc = MQTTClient_create(&client, ADDRESS, CLIENTID, MQTTCLIENT_PERSISTENCE_NONE, NULL); 30 | 31 | conn_opts.keepAliveInterval = 20; 32 | conn_opts.reliable = 0; 33 | conn_opts.cleansession = 1; 34 | ssl_opts.enableServerCertAuth = 0; 35 | 36 | conn_opts.ssl = &ssl_opts; 37 | 38 | if ((rc = MQTTClient_connect(client, &conn_opts)) != MQTTCLIENT_SUCCESS) 39 | { 40 | ArPahoLogError("Failed to connect, return code %d\n", rc); 41 | } 42 | else 43 | { 44 | 45 | char topicName[20] = ""; 46 | int topicLength ; 47 | MQTTClient_message * recvMessage ; 48 | 49 | // subscribe 50 | MQTTClient_subscribe ( client , TOPIC , 0 ); 51 | 52 | while(PahoMQTT_IsAlive()) 53 | { 54 | MQTTClient_receive ( client, &topicName, &topicLength , &recvMessage , 10 ) ; 55 | 56 | if( topicName > 0 ) 57 | { 58 | ArPahoLogSuccess("Recieved Topic %s with message %s \n", topicName, recvMessage->payload); 59 | 60 | MQTTClient_freeMessage ( &recvMessage ) ; 61 | } 62 | 63 | PahoMQTT_Sleep(5000); 64 | } 65 | } 66 | MQTTClient_disconnect(client, 10000); 67 | MQTTClient_destroy(&client); 68 | 69 | } while(PahoMQTT_IsReset()); 70 | } 71 | -------------------------------------------------------------------------------- /SampleNL/SecureSampleTestServer.c: -------------------------------------------------------------------------------- 1 | #ifdef _DEFAULT_INCLUDES 2 | #include 3 | #endif 4 | 5 | #include 6 | #include 7 | #include 8 | #include "MQTTClient.h" 9 | #include "ar/logger.h" 10 | 11 | #define ADDRESS "ssl://test.mosquitto.org:8883" 12 | #define CLIENTID "ExampleTestServer" 13 | #define TOPIC "test" 14 | #define PAYLOAD message 15 | #define QOS 1 16 | #define TIMEOUT 10000L 17 | 18 | void secureSampleTestServer(unsigned long param) 19 | { 20 | char *message = (char *)param; 21 | 22 | do 23 | { 24 | MQTTClient client; 25 | MQTTClient_init_options testsss = MQTTClient_init_options_initializer ; 26 | MQTTClient_connectOptions conn_opts = MQTTClient_connectOptions_initializer; 27 | MQTTClient_message pubmsg = MQTTClient_message_initializer; 28 | MQTTClient_deliveryToken token; 29 | MQTTClient_SSLOptions ssl_opts = MQTTClient_SSLOptions_initializer; 30 | int rc = 0; 31 | 32 | testsss.do_openssl_init = 1 ; 33 | // MQTTClient_global_init(&testsss); 34 | 35 | rc = MQTTClient_create(&client, ADDRESS, CLIENTID, MQTTCLIENT_PERSISTENCE_NONE, NULL); 36 | 37 | conn_opts.keepAliveInterval = 20; 38 | conn_opts.reliable = 0; 39 | conn_opts.cleansession = 1; 40 | //conn_opts.username = "BuR"; 41 | //conn_opts.password = "BuR"; 42 | ssl_opts.enableServerCertAuth = 0; 43 | 44 | 45 | conn_opts.ssl = &ssl_opts; 46 | 47 | if ((rc = MQTTClient_connect(client, &conn_opts)) != MQTTCLIENT_SUCCESS) 48 | { 49 | ArPahoLogError("Failed to connect, return code %d\n", rc); 50 | } 51 | else 52 | { 53 | while(PahoMQTT_IsAlive()) 54 | { 55 | pubmsg.payload = PAYLOAD; 56 | pubmsg.payloadlen = strlen(PAYLOAD); 57 | pubmsg.qos = QOS; 58 | pubmsg.retained = 0; 59 | MQTTClient_publishMessage(client, TOPIC, &pubmsg, &token); 60 | ArPahoLogInfo("Waiting for up to %d seconds for publication of %s\n" 61 | "on topic %s for client with ClientID: %s\n", 62 | (int)(TIMEOUT/1000), PAYLOAD, TOPIC, CLIENTID); 63 | rc = MQTTClient_waitForCompletion(client, token, TIMEOUT); 64 | ArPahoLogSuccess("Message with delivery token %d delivered\n", token); 65 | 66 | PahoMQTT_Sleep(5000); 67 | } 68 | } 69 | MQTTClient_disconnect(client, 10000); 70 | MQTTClient_destroy(&client); 71 | 72 | } while(PahoMQTT_IsReset()); 73 | } 74 | -------------------------------------------------------------------------------- /SampleNL/Variables.var: -------------------------------------------------------------------------------- 1 | VAR 2 | PahoMQTT_Cyclic_0 : PahoMQTT_Cyclic; 3 | Message : STRING[80] := 'Hello World!'; 4 | PahoMQTT_Init_0 : PahoMQTT_Init; 5 | test : BOOL; 6 | END_VAR 7 | -------------------------------------------------------------------------------- /SampleNL/heapsize.cpp: -------------------------------------------------------------------------------- 1 | unsigned long bur_heap_size = 1000000; 2 | -------------------------------------------------------------------------------- /SampleParam/ANSIC.prg: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Param.h 6 | Param.c 7 | Main.c 8 | Sample.c 9 | Variables.var 10 | heapsize.cpp 11 | 12 | -------------------------------------------------------------------------------- /SampleParam/Main.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "Param.h" 4 | 5 | #ifdef _DEFAULT_INCLUDES 6 | #include 7 | #endif 8 | 9 | void sample(unsigned long param_adr); 10 | 11 | _LOCAL param_typ Param; 12 | 13 | void _INIT ProgramInit(void) 14 | { 15 | PahoMQTT_Cyclic_0.LoggerLevel = 4; 16 | 17 | PahoMQTT_Init_0.EnableLogger = 1; 18 | PahoMQTT_Init_0.MainThread = (UDINT)sample; 19 | PahoMQTT_Init_0.ThreadParam = (UDINT)&Param; 20 | PahoMQTT_Init_0.SuspendThread = 1; 21 | PahoMQTT_Init(&PahoMQTT_Init_0); 22 | } 23 | 24 | 25 | void _CYCLIC ProgramCyclic(void) 26 | { 27 | PahoMQTT_Cyclic_0.Reset = Param.restart; 28 | PahoMQTT_Cyclic(&PahoMQTT_Cyclic_0); 29 | 30 | switch(loadTestCase) 31 | { 32 | case 1: 33 | { 34 | param_typ p = PARAM_INIT_200ms; 35 | ST_name(0,p.clientname,0); 36 | Param = p; 37 | } 38 | break; 39 | case 2: 40 | { 41 | param_typ p = PARAM_INIT_SSL_Login; 42 | ST_name(0,p.clientname,0); 43 | Param = p; 44 | } 45 | break; 46 | case 3: 47 | { 48 | param_typ p = PARAM_INIT_SSL_Certs; 49 | ST_name(0,p.clientname,0); 50 | Param = p; 51 | } 52 | break; 53 | case 4: 54 | { 55 | param_typ p = PARAM_INIT_SSL_CertsRoot; 56 | ST_name(0,p.clientname,0); 57 | Param = p; 58 | } 59 | break; 60 | } 61 | loadTestCase = 0; 62 | } 63 | 64 | void _EXIT ProgramExit(void) 65 | { 66 | PahoMQTT_Exit(); 67 | } 68 | -------------------------------------------------------------------------------- /SampleParam/Param.c: -------------------------------------------------------------------------------- 1 | #include "Param.h" 2 | 3 | int snprintf(char * s, size_t n, const char * format, ... ); 4 | 5 | void param_init(param_typ* param) 6 | { 7 | MQTTClient_SSLOptions ssl_opts = MQTTClient_SSLOptions_initializer; 8 | MQTTClient_connectOptions conn_opts = MQTTClient_connectOptions_initializer; 9 | 10 | param->ssl_opts = ssl_opts; 11 | param->conn_opts = conn_opts; 12 | 13 | 14 | param->conn_opts.keepAliveInterval = 10; 15 | param->conn_opts.reliable = param->reliable; 16 | param->conn_opts.cleansession = param->clean; 17 | 18 | conn_opts.username = param->user; 19 | conn_opts.password = param->password; 20 | 21 | if(!param->ip[0]) snprintf(param->ip, sizeof(param->ip)-1, "192.168.1.187"); 22 | 23 | if(param->ssl) 24 | { 25 | param->conn_opts.ssl = ¶m->ssl_opts; 26 | 27 | if(!param->port) param->port = 8883; 28 | snprintf(param->url,sizeof(param->url)-1,"ssl://%s:%d",param->ip,param->port); 29 | if(!param->message[0]) snprintf(param->message,sizeof(param->message)-1, "hello secure world!"); 30 | 31 | param->ssl_opts.enableServerCertAuth = 0; 32 | param->ssl_opts.enabledCipherSuites = "ALL"; 33 | 34 | if(param->certs) 35 | { 36 | param->ssl_opts.trustStore = "ca.crt"; 37 | if(!param->certs_onlyroot) 38 | { 39 | param->ssl_opts.keyStore = "client.crt"; 40 | param->ssl_opts.privateKey = "client.key"; 41 | param->ssl_opts.privateKeyPassword = param->password; 42 | } 43 | 44 | } 45 | 46 | } 47 | else 48 | { 49 | if(!param->port) param->port = 1883; 50 | snprintf(param->url,sizeof(param->url)-1,"tcp://%s:%d",param->ip,param->port); 51 | if(!param->message[0]) snprintf(param->message,sizeof(param->message)-1, "hello world!"); 52 | 53 | } 54 | if(!param->timeout) param->timeout = 5000; 55 | if(!param->sleep) param->sleep = 2000; 56 | } 57 | -------------------------------------------------------------------------------- /SampleParam/Param.h: -------------------------------------------------------------------------------- 1 | #ifndef _PARAM_H_ 2 | #define _PARAM_H_ 3 | 4 | #include 5 | #include "MQTTClient.h" 6 | 7 | typedef struct 8 | { 9 | BOOL restart; 10 | BOOL ssl; 11 | BOOL clean; 12 | BOOL login; 13 | BOOL certs; 14 | BOOL certs_onlyroot; 15 | BOOL reliable; 16 | STRING user[20]; 17 | STRING password[20]; 18 | UINT port; 19 | UDINT sleep; 20 | UDINT timeout; 21 | STRING ip[30]; 22 | STRING url[50]; 23 | UDINT cycles; 24 | STRING clientname[80]; 25 | STRING topic[80]; 26 | STRING message[256]; 27 | MQTTClient_SSLOptions ssl_opts; 28 | MQTTClient_connectOptions conn_opts; 29 | 30 | } param_typ; 31 | 32 | void param_init(param_typ* param); 33 | 34 | #define PARAM_INIT_200ms { 0, 0, 1, 0, 0, 0, 1, "", "", 0, 200, 0,"", "", 0, "MyClient", "World Topic", "Hello World plain!"} //mosquitto -p 1883 -v 35 | #define PARAM_INIT_SSL_Login { 0, 1, 1, 1, 0, 0, 1, "user", "user", 0, 200, 0,"", "", 0, "MyClient", "World SSL Topic", "Hello World JUST Login!"} //default 36 | #define PARAM_INIT_SSL_Certs { 0, 1, 1, 1, 1, 0, 1, "user", "", 0, 200, 0,"", "", 0, "MyClient", "World SSL Topic", "Hello World with all CERTS!"} //default 37 | #define PARAM_INIT_SSL_CertsRoot { 0, 1, 1, 1, 1, 1, 1, "user", "", 0, 200, 0,"", "", 0, "MyClient", "World SSL Topic", "Hello World with ROOT CA!"} //default 38 | 39 | #endif -------------------------------------------------------------------------------- /SampleParam/README.md: -------------------------------------------------------------------------------- 1 | ## SampleParam 2 | 3 | This is an enhancement of the secureSampleStayAlive Task, with the possiblity to easily reconnect to another server or change the connection / SSL paramaters. 4 | 5 | ### Parameters 6 | 7 | The sample is named "Param" because of the rather huge parameter structure that is passed to the sample thread. The Param structure is a local structure, defined in the C code, 8 | 9 | _LOCAL param_typ Param; 10 | 11 | Which means you need to activate Declaration of _LOCAL _GLOBAL Variables in 12 | **Project -> Properties -> ANSI C/C++ Compliance** 13 | 14 | Theres a **loadTestCase** variable that intializes some test setups 15 | 16 | 1. connect on port 1883 with 200ms refresh 17 | 2. connect on port 8883 (SSL) with login user/user and 200ms refresh 18 | 3. connect on port 8883 (SSL) with login user, and certificates and 200ms refresh 19 | 4. connect on port 8883 (SSL) with login user, and a root certificate and 200ms refresh 20 | 21 | Anyways, the idea is that you can select some things like ssl, login, reliable and so on, then the actual connection and SSL parameters are initialized once you activate the main thread with PahoMQTT_Cyclic.Resume, **-or-** which is the best thing about this sample, if you set **Param.reset**. 22 | 23 | In order to figure out exactly what is initialized to what, have a look at Param.c 24 | 25 | void param_init(param_typ* param) 26 | 27 | ### Multiple instances ### 28 | 29 | This Task can be used for several client instances, by assigning the same code to the CPU several times. For multiple clients to work, the PahoMQTT needs to run as a static library, described in the top-level README. 30 | 31 | In case you want to connect to the same broker on the same port (which is totally possible), you just need to make sure every Task instance uses another client name. Easiest way out is to write 32 | 33 | ST_name(0, Param.clientname, 0); 34 | 35 | With that, the MQTT gets the name of the task in the Software configuration, which is unique. 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /SampleParam/Sample.c: -------------------------------------------------------------------------------- 1 | #ifdef _DEFAULT_INCLUDES 2 | #include 3 | #endif 4 | 5 | #include 6 | #include 7 | #include 8 | #include "MQTTClient.h" 9 | #include "ar/logger.h" 10 | #include "Param.h" 11 | 12 | #define ADDRESS param->url 13 | #define CLIENTID param->clientname 14 | #define TOPIC param->topic 15 | #define PAYLOAD param->message 16 | #define QOS 1 17 | #define TIMEOUT param->timeout 18 | 19 | void sample(unsigned long param_adr) 20 | { 21 | param_typ *param = (param_typ *)param_adr; 22 | 23 | do 24 | { 25 | param->restart = 0; 26 | param->cycles = 0; 27 | param_init(param); 28 | 29 | MQTTClient client; 30 | MQTTClient_message pubmsg = MQTTClient_message_initializer; 31 | MQTTClient_deliveryToken token; 32 | 33 | int rc; 34 | MQTTClient_create(&client, ADDRESS, CLIENTID, MQTTCLIENT_PERSISTENCE_NONE, NULL); 35 | 36 | while(PahoMQTT_IsAlive()) 37 | { 38 | 39 | if ((rc = MQTTClient_connect(client, ¶m->conn_opts)) != MQTTCLIENT_SUCCESS) 40 | { 41 | ArPahoLogError("Failed to connect, return code %d\n", rc); 42 | PahoMQTT_Sleep(TIMEOUT); 43 | } 44 | else 45 | { 46 | while(MQTTClient_isConnected(client) && PahoMQTT_IsAlive()) 47 | { 48 | pubmsg.payload = PAYLOAD; 49 | pubmsg.payloadlen = strlen(PAYLOAD); 50 | pubmsg.qos = QOS; 51 | pubmsg.retained = 0; 52 | MQTTClient_publishMessage(client, TOPIC, &pubmsg, &token); 53 | ArPahoLogInfo("Waiting for up to %d seconds for publication of %s\n" 54 | "on topic %s for client with ClientID: %s\n", 55 | (int)(TIMEOUT/1000), PAYLOAD, TOPIC, CLIENTID); 56 | rc = MQTTClient_waitForCompletion(client, token, TIMEOUT); 57 | ArPahoLogSuccess("Message with delivery token %d delivered\n", token); 58 | 59 | param->cycles++; 60 | PahoMQTT_Sleep(param->sleep); 61 | } 62 | } 63 | } 64 | MQTTClient_disconnect(client, TIMEOUT); 65 | MQTTClient_destroy(&client); 66 | 67 | } while(PahoMQTT_IsReset()); 68 | } 69 | -------------------------------------------------------------------------------- /SampleParam/Variables.var: -------------------------------------------------------------------------------- 1 | VAR 2 | loadTestCase : USINT; 3 | PahoMQTT_Cyclic_0 : PahoMQTT_Cyclic; 4 | PahoMQTT_Init_0 : PahoMQTT_Init; 5 | END_VAR 6 | -------------------------------------------------------------------------------- /SampleParam/heapsize.cpp: -------------------------------------------------------------------------------- 1 | unsigned long bur_heap_size = 1000000; 2 | -------------------------------------------------------------------------------- /img/add_lib.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/img/add_lib.PNG -------------------------------------------------------------------------------- /img/add_prog.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/img/add_prog.PNG -------------------------------------------------------------------------------- /img/compiler.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/img/compiler.PNG -------------------------------------------------------------------------------- /img/enable_dns.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/img/enable_dns.PNG -------------------------------------------------------------------------------- /img/file_device.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/img/file_device.PNG -------------------------------------------------------------------------------- /img/headers.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/img/headers.PNG -------------------------------------------------------------------------------- /img/heapsize.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/img/heapsize.PNG -------------------------------------------------------------------------------- /img/lib_static.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/img/lib_static.PNG -------------------------------------------------------------------------------- /img/libs.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/img/libs.PNG -------------------------------------------------------------------------------- /img/linker_properties.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/img/linker_properties.PNG -------------------------------------------------------------------------------- /img/logger.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/img/logger.PNG -------------------------------------------------------------------------------- /img/software.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/img/software.PNG -------------------------------------------------------------------------------- /img/task_properties.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/img/task_properties.PNG -------------------------------------------------------------------------------- /img/transfer_settings.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/img/transfer_settings.PNG -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/Binary.lby: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Types.typ 6 | Constants.var 7 | PahoMQTT.fun 8 | Clients.h 9 | Heap.h 10 | LinkedList.h 11 | Log.h 12 | Messages.h 13 | MQTTClient.h 14 | MQTTClientPersistence.h 15 | MQTTPacket.h 16 | MQTTPacketOut.h 17 | MQTTPersistence.h 18 | MQTTPersistenceDefault.h 19 | MQTTProtocol.h 20 | MQTTProtocolClient.h 21 | MQTTProtocolOut.h 22 | Socket.h 23 | SocketBuffer.h 24 | SSLSocket.h 25 | StackTrace.h 26 | Thread.h 27 | Tree.h 28 | utf-8.h 29 | VersionInfo.h 30 | ar 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/Constants.var: -------------------------------------------------------------------------------- 1 | VAR CONSTANT 2 | 3 | END_VAR 4 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/Heap.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - use tree data structure instead of list 16 | *******************************************************************************/ 17 | 18 | 19 | #if !defined(HEAP_H) 20 | #define HEAP_H 21 | 22 | #if defined(HIGH_PERFORMANCE) 23 | #define NO_HEAP_TRACKING 1 24 | #endif 25 | 26 | #include 27 | #ifndef _SG4 28 | # include 29 | #endif 30 | #include 31 | 32 | #if !defined(NO_HEAP_TRACKING) 33 | /** 34 | * redefines malloc to use "mymalloc" so that heap allocation can be tracked 35 | * @param x the size of the item to be allocated 36 | * @return the pointer to the item allocated, or NULL 37 | */ 38 | #define malloc(x) mymalloc(__FILE__, __LINE__, x) 39 | 40 | /** 41 | * redefines realloc to use "myrealloc" so that heap allocation can be tracked 42 | * @param a the heap item to be reallocated 43 | * @param b the new size of the item 44 | * @return the new pointer to the heap item 45 | */ 46 | #define realloc(a, b) myrealloc(__FILE__, __LINE__, a, b) 47 | 48 | /** 49 | * redefines free to use "myfree" so that heap allocation can be tracked 50 | * @param x the size of the item to be freed 51 | */ 52 | #define free(x) myfree(__FILE__, __LINE__, x) 53 | 54 | #endif 55 | 56 | /** 57 | * Information about the state of the heap. 58 | */ 59 | typedef struct 60 | { 61 | size_t current_size; /**< current size of the heap in bytes */ 62 | size_t max_size; /**< max size the heap has reached in bytes */ 63 | } heap_info; 64 | 65 | 66 | void* mymalloc(char*, int, size_t size); 67 | void* myrealloc(char*, int, void* p, size_t size); 68 | void myfree(char*, int, void* p); 69 | 70 | void Heap_scan(FILE* file); 71 | int Heap_initialize(void); 72 | void Heap_terminate(void); 73 | heap_info* Heap_get_info(void); 74 | int HeapDump(FILE* file); 75 | int HeapDumpString(FILE* file, char* str); 76 | void* Heap_findItem(void* p); 77 | void Heap_unlink(char* file, int line, void* p); 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/Log.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - updates for the async client 16 | *******************************************************************************/ 17 | 18 | #if !defined(LOG_H) 19 | #define LOG_H 20 | 21 | /*BE 22 | map LOG_LEVELS 23 | { 24 | "TRACE_MAXIMUM" 1 25 | "TRACE_MEDIUM" 2 26 | "TRACE_MINIMUM" 3 27 | "TRACE_PROTOCOL" 4 28 | 29 | "ERROR" 5 30 | "SEVERE" 6 31 | "FATAL" 7 32 | } 33 | BE*/ 34 | 35 | enum LOG_LEVELS { 36 | INVALID_LEVEL = -1, 37 | TRACE_MAXIMUM = 1, 38 | TRACE_MEDIUM, 39 | TRACE_MINIMUM, 40 | TRACE_PROTOCOL, 41 | LOG_ERROR, 42 | LOG_SEVERE, 43 | LOG_FATAL, 44 | }; 45 | 46 | 47 | /*BE 48 | def trace_settings_type 49 | { 50 | n32 map LOG_LEVELS "trace_level" 51 | n32 dec "max_trace_entries" 52 | n32 dec "trace_output_level" 53 | } 54 | BE*/ 55 | typedef struct 56 | { 57 | enum LOG_LEVELS trace_level; /**< trace level */ 58 | int max_trace_entries; /**< max no of entries in the trace buffer */ 59 | enum LOG_LEVELS trace_output_level; /**< trace level to output to destination */ 60 | } trace_settings_type; 61 | 62 | extern trace_settings_type trace_settings; 63 | 64 | #define LOG_PROTOCOL TRACE_PROTOCOL 65 | 66 | #define TRACE_MAX TRACE_MAXIMUM 67 | #define TRACE_MED TRACE_MEDIUM 68 | #define TRACE_MIN TRACE_MINIMUM 69 | 70 | typedef struct 71 | { 72 | const char* name; 73 | const char* value; 74 | } Log_nameValue; 75 | 76 | int Log_initialize(Log_nameValue*); 77 | void Log_terminate(void); 78 | 79 | void Log(enum LOG_LEVELS, int, const char *, ...); 80 | void Log_stackTrace(enum LOG_LEVELS, int, int, int, const char*, int, int*); 81 | 82 | typedef void Log_traceCallback(enum LOG_LEVELS level, const char *message); 83 | void Log_setTraceCallback(Log_traceCallback* callback); 84 | void Log_setTraceLevel(enum LOG_LEVELS level); 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/MQTTPacketOut.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs, Allan Stockdill-Mander - SSL updates 16 | * Ian Craggs - MQTT 3.1.1 support 17 | *******************************************************************************/ 18 | 19 | #if !defined(MQTTPACKETOUT_H) 20 | #define MQTTPACKETOUT_H 21 | 22 | #include "MQTTPacket.h" 23 | 24 | int MQTTPacket_send_connect(Clients* client, int MQTTVersion); 25 | void* MQTTPacket_connack(unsigned char aHeader, char* data, size_t datalen); 26 | 27 | int MQTTPacket_send_pingreq(networkHandles* net, const char* clientID); 28 | 29 | int MQTTPacket_send_subscribe(List* topics, List* qoss, int msgid, int dup, networkHandles* net, const char* clientID); 30 | void* MQTTPacket_suback(unsigned char aHeader, char* data, size_t datalen); 31 | 32 | int MQTTPacket_send_unsubscribe(List* topics, int msgid, int dup, networkHandles* net, const char* clientID); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/MQTTPersistence.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - async client updates 16 | * Ian Craggs - fix for bug 432903 - queue persistence 17 | *******************************************************************************/ 18 | 19 | #if defined(__cplusplus) 20 | extern "C" { 21 | #endif 22 | 23 | #include "Clients.h" 24 | 25 | /** Stem of the key for a sent PUBLISH QoS1 or QoS2 */ 26 | #define PERSISTENCE_PUBLISH_SENT "s-" 27 | /** Stem of the key for a sent PUBREL */ 28 | #define PERSISTENCE_PUBREL "sc-" 29 | /** Stem of the key for a received PUBLISH QoS2 */ 30 | #define PERSISTENCE_PUBLISH_RECEIVED "r-" 31 | /** Stem of the key for an async client command */ 32 | #define PERSISTENCE_COMMAND_KEY "c-" 33 | /** Stem of the key for an async client message queue */ 34 | #define PERSISTENCE_QUEUE_KEY "q-" 35 | #define PERSISTENCE_MAX_KEY_LENGTH 8 36 | 37 | int MQTTPersistence_create(MQTTClient_persistence** per, int type, void* pcontext); 38 | int MQTTPersistence_initialize(Clients* c, const char* serverURI); 39 | int MQTTPersistence_close(Clients* c); 40 | int MQTTPersistence_clear(Clients* c); 41 | int MQTTPersistence_restore(Clients* c); 42 | void* MQTTPersistence_restorePacket(char* buffer, size_t buflen); 43 | void MQTTPersistence_insertInOrder(List* list, void* content, size_t size); 44 | int MQTTPersistence_put(int socket, char* buf0, size_t buf0len, int count, 45 | char** buffers, size_t* buflens, int htype, int msgId, int scr); 46 | int MQTTPersistence_remove(Clients* c, char* type, int qos, int msgId); 47 | void MQTTPersistence_wrapMsgID(Clients *c); 48 | 49 | typedef struct 50 | { 51 | char struct_id[4]; 52 | int struct_version; 53 | int payloadlen; 54 | void* payload; 55 | int qos; 56 | int retained; 57 | int dup; 58 | int msgid; 59 | } MQTTPersistence_message; 60 | 61 | typedef struct 62 | { 63 | MQTTPersistence_message* msg; 64 | char* topicName; 65 | int topicLen; 66 | unsigned int seqno; /* only used on restore */ 67 | } MQTTPersistence_qEntry; 68 | 69 | int MQTTPersistence_unpersistQueueEntry(Clients* client, MQTTPersistence_qEntry* qe); 70 | int MQTTPersistence_persistQueueEntry(Clients* aclient, MQTTPersistence_qEntry* qe); 71 | int MQTTPersistence_restoreMessageQueue(Clients* c); 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/MQTTPersistenceDefault.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | *******************************************************************************/ 16 | 17 | /** 8.3 filesystem */ 18 | #define MESSAGE_FILENAME_LENGTH 8 19 | /** Extension of the filename */ 20 | #define MESSAGE_FILENAME_EXTENSION ".msg" 21 | 22 | /* prototypes of the functions for the default file system persistence */ 23 | int pstopen(void** handle, const char* clientID, const char* serverURI, void* context); 24 | int pstclose(void* handle); 25 | int pstput(void* handle, char* key, int bufcount, char* buffers[], int buflens[]); 26 | int pstget(void* handle, char* key, char** buffer, int* buflen); 27 | int pstremove(void* handle, char* key); 28 | int pstkeys(void* handle, char*** keys, int* nkeys); 29 | int pstclear(void* handle); 30 | int pstcontainskey(void* handle, char* key); 31 | 32 | int pstmkdir(char *pPathname); 33 | 34 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/MQTTProtocol.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - MQTT 3.1.1 updates 16 | *******************************************************************************/ 17 | 18 | #if !defined(MQTTPROTOCOL_H) 19 | #define MQTTPROTOCOL_H 20 | 21 | #include "LinkedList.h" 22 | #include "MQTTPacket.h" 23 | #include "Clients.h" 24 | 25 | #define MAX_MSG_ID 65535 26 | #define MAX_CLIENTID_LEN 65535 27 | 28 | typedef struct 29 | { 30 | int socket; 31 | Publications* p; 32 | } pending_write; 33 | 34 | 35 | typedef struct 36 | { 37 | List publications; 38 | unsigned int msgs_received; 39 | unsigned int msgs_sent; 40 | List pending_writes; /* for qos 0 writes not complete */ 41 | } MQTTProtocol; 42 | 43 | 44 | #include "MQTTProtocolOut.h" 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/MQTTProtocolClient.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs, Allan Stockdill-Mander - SSL updates 16 | * Ian Craggs - MQTT 3.1.1 updates 17 | * Rong Xiang, Ian Craggs - C++ compatibility 18 | *******************************************************************************/ 19 | 20 | #if !defined(MQTTPROTOCOLCLIENT_H) 21 | #define MQTTPROTOCOLCLIENT_H 22 | 23 | #include "LinkedList.h" 24 | #include "MQTTPacket.h" 25 | #include "Log.h" 26 | #include "MQTTProtocol.h" 27 | #include "Messages.h" 28 | 29 | #define MAX_MSG_ID 65535 30 | #define MAX_CLIENTID_LEN 65535 31 | 32 | int MQTTProtocol_startPublish(Clients* pubclient, Publish* publish, int qos, int retained, Messages** m); 33 | Messages* MQTTProtocol_createMessage(Publish* publish, Messages** mm, int qos, int retained); 34 | Publications* MQTTProtocol_storePublication(Publish* publish, int* len); 35 | int messageIDCompare(void* a, void* b); 36 | int MQTTProtocol_assignMsgId(Clients* client); 37 | void MQTTProtocol_removePublication(Publications* p); 38 | void Protocol_processPublication(Publish* publish, Clients* client); 39 | 40 | int MQTTProtocol_handlePublishes(void* pack, int sock); 41 | int MQTTProtocol_handlePubacks(void* pack, int sock); 42 | int MQTTProtocol_handlePubrecs(void* pack, int sock); 43 | int MQTTProtocol_handlePubrels(void* pack, int sock); 44 | int MQTTProtocol_handlePubcomps(void* pack, int sock); 45 | 46 | void MQTTProtocol_closeSession(Clients* c, int sendwill); 47 | void MQTTProtocol_keepalive(time_t); 48 | void MQTTProtocol_retry(time_t, int, int); 49 | void MQTTProtocol_freeClient(Clients* client); 50 | void MQTTProtocol_emptyMessageList(List* msgList); 51 | void MQTTProtocol_freeMessageList(List* msgList); 52 | 53 | char* MQTTStrncpy(char *dest, const char* src, size_t num); 54 | char* MQTTStrdup(const char* src); 55 | #endif 56 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/MQTTProtocolOut.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2017 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs, Allan Stockdill-Mander - SSL updates 16 | * Ian Craggs - MQTT 3.1.1 support 17 | * Ian Craggs - SNI support 18 | *******************************************************************************/ 19 | 20 | #if !defined(MQTTPROTOCOLOUT_H) 21 | #define MQTTPROTOCOLOUT_H 22 | 23 | #if defined(_SG4) && !defined(OPENSSL) 24 | # define OPENSSL 25 | #endif 26 | 27 | #include "LinkedList.h" 28 | #include "MQTTPacket.h" 29 | #include "Clients.h" 30 | #include "Log.h" 31 | #include "Messages.h" 32 | #include "MQTTProtocol.h" 33 | #include "MQTTProtocolClient.h" 34 | 35 | #define DEFAULT_PORT 1883 36 | 37 | char* MQTTProtocol_addressPort(const char* uri, int* port); 38 | void MQTTProtocol_reconnect(const char* ip_address, Clients* client); 39 | #if defined(OPENSSL) 40 | int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int ssl, int MQTTVersion); 41 | #else 42 | int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int MQTTVersion); 43 | #endif 44 | int MQTTProtocol_handlePingresps(void* pack, int sock); 45 | int MQTTProtocol_subscribe(Clients* client, List* topics, List* qoss, int msgID); 46 | int MQTTProtocol_handleSubacks(void* pack, int sock); 47 | int MQTTProtocol_unsubscribe(Clients* client, List* topics, int msgID); 48 | int MQTTProtocol_handleUnsubacks(void* pack, int sock); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/Messages.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | *******************************************************************************/ 16 | 17 | #if !defined(MESSAGES_H) 18 | #define MESSAGES_H 19 | 20 | #include "Log.h" 21 | 22 | const char* Messages_get(int, enum LOG_LEVELS); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/PahoMQTT.fun: -------------------------------------------------------------------------------- 1 | 2 | FUNCTION_BLOCK PahoMQTT_Cyclic 3 | VAR_INPUT 4 | LoggerLevel : USINT; (*0: ERROR, 1: WARNING, 2: INFO, 3: SUCCESS, 4: TRACE*) 5 | Resume : BOOL; (*Start the main thread (if not already running)*) 6 | Suspend : BOOL; (*Pause the main thread from a system perspective, yield everything*) 7 | END_VAR 8 | VAR_OUTPUT 9 | Alive : BOOL; (*Check whether the SDK_Exit has been called to kill the thread.*) 10 | Running : BOOL; (*Main thread is running*) 11 | Status : UINT; (*Status from Rtk functions*) 12 | ErrorInfo : STRING[80]; (*Error message*) 13 | END_VAR 14 | VAR 15 | _LoggerLevel : USINT; 16 | _Resume : BOOL; 17 | _Suspend : BOOL; 18 | _inst : UDINT; 19 | END_VAR 20 | END_FUNCTION_BLOCK 21 | 22 | FUNCTION PahoMQTT_Exit : BOOL (*Kill the main thread, should be used in _EXIT*) 23 | END_FUNCTION 24 | 25 | FUNCTION PahoMQTT_Sleep : BOOL (*Sleep the main thread for a certain period of time (ms)*) 26 | VAR_INPUT 27 | Milliseconds : UDINT; 28 | END_VAR 29 | END_FUNCTION 30 | 31 | FUNCTION PahoMQTT_IsAlive : BOOL (*Check whether the SDK_Exit has been called to kill the thread. should be used inside the main while() loop, to disconnect properly if the task is retransferred*) 32 | END_FUNCTION 33 | 34 | FUNCTION_BLOCK PahoMQTT_Init 35 | VAR_INPUT 36 | EnableLogger : BOOL; (*Activate AR Logging: MQTT_LOG and enable ERROR messages*) 37 | MainThread : UDINT; (*Function pointer to main thread with following signature: void sample(UDINT param)*) 38 | ThreadParam : UDINT; (*Pointer to parameter (structure) passed to the main thread in param*) 39 | SuspendThread : BOOL; (*Create the main thread in suspended mode, that you can start it with PahoMQTT_Cyclic.Resume. Useful for debugging*) 40 | ThreadName : STRING[13]; (*Unique name of the main thread, required for multiple instances / clients on one target.*) 41 | END_VAR 42 | VAR_OUTPUT 43 | Done : BOOL; 44 | Error : BOOL; (*Error occured during initialization*) 45 | ErrorInfo : STRING[80]; (*Error message*) 46 | Status : UINT; (*Status from RtkCreateTask*) 47 | END_VAR 48 | END_FUNCTION_BLOCK 49 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/SG3/PahoMQTT.h: -------------------------------------------------------------------------------- 1 | /* Automation Studio generated header file */ 2 | /* Do not edit ! */ 3 | /* PahoMQTT 4.26.0 */ 4 | 5 | #ifndef _PAHOMQTT_ 6 | #define _PAHOMQTT_ 7 | #ifdef __cplusplus 8 | extern "C" 9 | { 10 | #endif 11 | #ifndef _PahoMQTT_VERSION 12 | #define _PahoMQTT_VERSION 4.26.0 13 | #endif 14 | 15 | #include 16 | 17 | #ifndef _BUR_PUBLIC 18 | #define _BUR_PUBLIC 19 | #endif 20 | #ifdef _SG4 21 | #include "AsIecCon.h" 22 | #include "AsHW.h" 23 | #include "AsETH.h" 24 | #include "FileIO.h" 25 | #include "AsHost.h" 26 | #include "ArEventLog.h" 27 | #include "sys_lib.h" 28 | #endif 29 | #ifdef _SG3 30 | #include "AsIecCon.h" 31 | #include "AsHW.h" 32 | #include "AsETH.h" 33 | #include "FileIO.h" 34 | #include "AsHost.h" 35 | #include "ArEventLog.h" 36 | #include "sys_lib.h" 37 | #endif 38 | #ifdef _SGC 39 | #include "AsIecCon.h" 40 | #include "AsHW.h" 41 | #include "AsETH.h" 42 | #include "FileIO.h" 43 | #include "AsHost.h" 44 | #include "ArEventLog.h" 45 | #include "sys_lib.h" 46 | #endif 47 | 48 | /* Datatypes and datatypes of function blocks */ 49 | typedef struct PahoMQTT_Cyclic 50 | { 51 | /* VAR_INPUT (analog) */ 52 | unsigned char LoggerLevel; 53 | /* VAR_OUTPUT (analog) */ 54 | unsigned short Status; 55 | plcstring ErrorInfo[81]; 56 | /* VAR (analog) */ 57 | unsigned char _LoggerLevel; 58 | unsigned long _inst; 59 | /* VAR_INPUT (digital) */ 60 | plcbit Resume; 61 | plcbit Suspend; 62 | /* VAR_OUTPUT (digital) */ 63 | plcbit Alive; 64 | plcbit Running; 65 | /* VAR (digital) */ 66 | plcbit _Resume; 67 | plcbit _Suspend; 68 | } PahoMQTT_Cyclic_typ; 69 | 70 | typedef struct PahoMQTT_Init 71 | { 72 | /* VAR_INPUT (analog) */ 73 | unsigned long MainThread; 74 | unsigned long ThreadParam; 75 | plcstring ThreadName[14]; 76 | /* VAR_OUTPUT (analog) */ 77 | plcstring ErrorInfo[81]; 78 | unsigned short Status; 79 | /* VAR_INPUT (digital) */ 80 | plcbit EnableLogger; 81 | plcbit SuspendThread; 82 | /* VAR_OUTPUT (digital) */ 83 | plcbit Done; 84 | plcbit Error; 85 | } PahoMQTT_Init_typ; 86 | 87 | 88 | 89 | /* Prototyping of functions and function blocks */ 90 | _BUR_PUBLIC void PahoMQTT_Cyclic(struct PahoMQTT_Cyclic* inst); 91 | _BUR_PUBLIC void PahoMQTT_Init(struct PahoMQTT_Init* inst); 92 | _BUR_PUBLIC plcbit PahoMQTT_Exit(void); 93 | _BUR_PUBLIC plcbit PahoMQTT_Sleep(unsigned long Milliseconds); 94 | _BUR_PUBLIC plcbit PahoMQTT_IsAlive(void); 95 | 96 | 97 | #ifdef __cplusplus 98 | }; 99 | #endif 100 | #endif /* _PAHOMQTT_ */ 101 | 102 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/SG4/PahoMQTT.br: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.26.0-rev.10/PahoMQTT/V4.26.0/SG4/PahoMQTT.br -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/SG4/PahoMQTT.h: -------------------------------------------------------------------------------- 1 | /* Automation Studio generated header file */ 2 | /* Do not edit ! */ 3 | /* PahoMQTT 4.26.0 */ 4 | 5 | #ifndef _PAHOMQTT_ 6 | #define _PAHOMQTT_ 7 | #ifdef __cplusplus 8 | extern "C" 9 | { 10 | #endif 11 | #ifndef _PahoMQTT_VERSION 12 | #define _PahoMQTT_VERSION 4.26.0 13 | #endif 14 | 15 | #include 16 | 17 | #ifndef _BUR_PUBLIC 18 | #define _BUR_PUBLIC 19 | #endif 20 | #ifdef _SG4 21 | #include "AsIecCon.h" 22 | #include "AsHW.h" 23 | #include "AsETH.h" 24 | #include "FileIO.h" 25 | #include "AsHost.h" 26 | #include "ArEventLog.h" 27 | #include "sys_lib.h" 28 | #endif 29 | #ifdef _SG3 30 | #include "AsIecCon.h" 31 | #include "AsHW.h" 32 | #include "AsETH.h" 33 | #include "FileIO.h" 34 | #include "AsHost.h" 35 | #include "ArEventLog.h" 36 | #include "sys_lib.h" 37 | #endif 38 | #ifdef _SGC 39 | #include "AsIecCon.h" 40 | #include "AsHW.h" 41 | #include "AsETH.h" 42 | #include "FileIO.h" 43 | #include "AsHost.h" 44 | #include "ArEventLog.h" 45 | #include "sys_lib.h" 46 | #endif 47 | 48 | /* Datatypes and datatypes of function blocks */ 49 | typedef struct PahoMQTT_Cyclic 50 | { 51 | /* VAR_INPUT (analog) */ 52 | unsigned char LoggerLevel; 53 | /* VAR_OUTPUT (analog) */ 54 | unsigned short Status; 55 | plcstring ErrorInfo[81]; 56 | /* VAR (analog) */ 57 | unsigned char _LoggerLevel; 58 | unsigned long _inst; 59 | /* VAR_INPUT (digital) */ 60 | plcbit Resume; 61 | plcbit Suspend; 62 | /* VAR_OUTPUT (digital) */ 63 | plcbit Alive; 64 | plcbit Running; 65 | /* VAR (digital) */ 66 | plcbit _Resume; 67 | plcbit _Suspend; 68 | } PahoMQTT_Cyclic_typ; 69 | 70 | typedef struct PahoMQTT_Init 71 | { 72 | /* VAR_INPUT (analog) */ 73 | unsigned long MainThread; 74 | unsigned long ThreadParam; 75 | plcstring ThreadName[14]; 76 | /* VAR_OUTPUT (analog) */ 77 | plcstring ErrorInfo[81]; 78 | unsigned short Status; 79 | /* VAR_INPUT (digital) */ 80 | plcbit EnableLogger; 81 | plcbit SuspendThread; 82 | /* VAR_OUTPUT (digital) */ 83 | plcbit Done; 84 | plcbit Error; 85 | } PahoMQTT_Init_typ; 86 | 87 | 88 | 89 | /* Prototyping of functions and function blocks */ 90 | _BUR_PUBLIC void PahoMQTT_Cyclic(struct PahoMQTT_Cyclic* inst); 91 | _BUR_PUBLIC void PahoMQTT_Init(struct PahoMQTT_Init* inst); 92 | _BUR_PUBLIC plcbit PahoMQTT_Exit(void); 93 | _BUR_PUBLIC plcbit PahoMQTT_Sleep(unsigned long Milliseconds); 94 | _BUR_PUBLIC plcbit PahoMQTT_IsAlive(void); 95 | 96 | 97 | #ifdef __cplusplus 98 | }; 99 | #endif 100 | #endif /* _PAHOMQTT_ */ 101 | 102 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/SG4/libPahoMQTT.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.26.0-rev.10/PahoMQTT/V4.26.0/SG4/libPahoMQTT.a -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/SG4/libPahoMQTT_s.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.26.0-rev.10/PahoMQTT/V4.26.0/SG4/libPahoMQTT_s.a -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/SGC/PahoMQTT.h: -------------------------------------------------------------------------------- 1 | /* Automation Studio generated header file */ 2 | /* Do not edit ! */ 3 | /* PahoMQTT 4.26.0 */ 4 | 5 | #ifndef _PAHOMQTT_ 6 | #define _PAHOMQTT_ 7 | #ifdef __cplusplus 8 | extern "C" 9 | { 10 | #endif 11 | #ifndef _PahoMQTT_VERSION 12 | #define _PahoMQTT_VERSION 4.26.0 13 | #endif 14 | 15 | #include 16 | 17 | #ifndef _BUR_PUBLIC 18 | #define _BUR_PUBLIC 19 | #endif 20 | #ifdef _SG4 21 | #include "AsIecCon.h" 22 | #include "AsHW.h" 23 | #include "AsETH.h" 24 | #include "FileIO.h" 25 | #include "AsHost.h" 26 | #include "ArEventLog.h" 27 | #include "sys_lib.h" 28 | #endif 29 | #ifdef _SG3 30 | #include "AsIecCon.h" 31 | #include "AsHW.h" 32 | #include "AsETH.h" 33 | #include "FileIO.h" 34 | #include "AsHost.h" 35 | #include "ArEventLog.h" 36 | #include "sys_lib.h" 37 | #endif 38 | #ifdef _SGC 39 | #include "AsIecCon.h" 40 | #include "AsHW.h" 41 | #include "AsETH.h" 42 | #include "FileIO.h" 43 | #include "AsHost.h" 44 | #include "ArEventLog.h" 45 | #include "sys_lib.h" 46 | #endif 47 | 48 | /* Datatypes and datatypes of function blocks */ 49 | typedef struct PahoMQTT_Cyclic 50 | { 51 | /* VAR_INPUT (analog) */ 52 | unsigned char LoggerLevel; 53 | /* VAR_OUTPUT (analog) */ 54 | unsigned short Status; 55 | plcstring ErrorInfo[81]; 56 | /* VAR (analog) */ 57 | unsigned char _LoggerLevel; 58 | unsigned long _inst; 59 | /* VAR_INPUT (digital) */ 60 | plcbit Resume; 61 | plcbit Suspend; 62 | /* VAR_OUTPUT (digital) */ 63 | plcbit Alive; 64 | plcbit Running; 65 | /* VAR (digital) */ 66 | plcbit _Resume; 67 | plcbit _Suspend; 68 | } PahoMQTT_Cyclic_typ; 69 | 70 | typedef struct PahoMQTT_Init 71 | { 72 | /* VAR_INPUT (analog) */ 73 | unsigned long MainThread; 74 | unsigned long ThreadParam; 75 | plcstring ThreadName[14]; 76 | /* VAR_OUTPUT (analog) */ 77 | plcstring ErrorInfo[81]; 78 | unsigned short Status; 79 | /* VAR_INPUT (digital) */ 80 | plcbit EnableLogger; 81 | plcbit SuspendThread; 82 | /* VAR_OUTPUT (digital) */ 83 | plcbit Done; 84 | plcbit Error; 85 | } PahoMQTT_Init_typ; 86 | 87 | 88 | 89 | /* Prototyping of functions and function blocks */ 90 | _BUR_PUBLIC void PahoMQTT_Cyclic(struct PahoMQTT_Cyclic* inst); 91 | _BUR_PUBLIC void PahoMQTT_Init(struct PahoMQTT_Init* inst); 92 | _BUR_PUBLIC plcbit PahoMQTT_Exit(void); 93 | _BUR_PUBLIC plcbit PahoMQTT_Sleep(unsigned long Milliseconds); 94 | _BUR_PUBLIC plcbit PahoMQTT_IsAlive(void); 95 | 96 | 97 | #ifdef __cplusplus 98 | }; 99 | #endif 100 | #endif /* _PAHOMQTT_ */ 101 | 102 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/SSLSocket.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2017 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs, Allan Stockdill-Mander - initial implementation 15 | * Ian Craggs - SNI support 16 | *******************************************************************************/ 17 | #if !defined(SSLSOCKET_H) 18 | #define SSLSOCKET_H 19 | 20 | #if defined(_SG4) && !defined(OPENSSL) 21 | # define OPENSSL 22 | #endif 23 | 24 | #if defined(_SG4) 25 | #define ssl_mutex_type unsigned long 26 | #elif defined(WIN32) || defined(WIN64) 27 | #define ssl_mutex_type HANDLE 28 | #else 29 | #include 30 | #include 31 | #define ssl_mutex_type pthread_mutex_t 32 | #endif 33 | 34 | #include 35 | #include "SocketBuffer.h" 36 | #include "Clients.h" 37 | 38 | #define URI_SSL "ssl://" 39 | 40 | /** if we should handle openssl initialization (bool_value == 1) or depend on it to be initalized externally (bool_value == 0) */ 41 | void SSLSocket_handleOpensslInit(int bool_value); 42 | 43 | int SSLSocket_initialize(void); 44 | void SSLSocket_terminate(void); 45 | int SSLSocket_setSocketForSSL(networkHandles* net, MQTTClient_SSLOptions* opts, char* hostname); 46 | 47 | int SSLSocket_getch(SSL* ssl, int socket, char* c); 48 | char *SSLSocket_getdata(SSL* ssl, int socket, size_t bytes, size_t* actual_len); 49 | 50 | int SSLSocket_close(networkHandles* net); 51 | int SSLSocket_putdatas(SSL* ssl, int socket, char* buf0, size_t buf0len, int count, char** buffers, size_t* buflens, int* frees); 52 | int SSLSocket_connect(SSL* ssl, int socket); 53 | 54 | int SSLSocket_getPendingRead(void); 55 | int SSLSocket_continueWrite(pending_writes* pw); 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/Thread.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2017 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial implementation 15 | * Ian Craggs, Allan Stockdill-Mander - async client updates 16 | * Ian Craggs - fix for bug #420851 17 | * Ian Craggs - change MacOS semaphore implementation 18 | *******************************************************************************/ 19 | #include "MQTTClient.h" 20 | 21 | #if !defined(THREAD_H) 22 | #define THREAD_H 23 | 24 | #if defined(_SG4) 25 | #define thread_type unsigned long 26 | #define thread_id_type unsigned long 27 | #define thread_return_type void 28 | typedef thread_return_type (*thread_fn)(unsigned long); 29 | #define mutex_type unsigned long 30 | #define cond_type unsigned long 31 | #define sem_type unsigned long 32 | #define WINAPI 33 | #elif defined(WIN32) || defined(WIN64) 34 | #include 35 | #define thread_type HANDLE 36 | #define thread_id_type DWORD 37 | #define thread_return_type DWORD 38 | #define thread_fn LPTHREAD_START_ROUTINE 39 | #define mutex_type HANDLE 40 | #define cond_type HANDLE 41 | #define sem_type HANDLE 42 | #else 43 | #include 44 | 45 | #define thread_type pthread_t 46 | #define thread_id_type pthread_t 47 | #define thread_return_type void* 48 | typedef thread_return_type (*thread_fn)(void*); 49 | #define mutex_type pthread_mutex_t* 50 | typedef struct { pthread_cond_t cond; pthread_mutex_t mutex; } cond_type_struct; 51 | typedef cond_type_struct *cond_type; 52 | #if defined(OSX) 53 | #include 54 | typedef dispatch_semaphore_t sem_type; 55 | #else 56 | #include 57 | typedef sem_t *sem_type; 58 | #endif 59 | 60 | cond_type Thread_create_cond(void); 61 | int Thread_signal_cond(cond_type); 62 | int Thread_wait_cond(cond_type condvar, int timeout); 63 | int Thread_destroy_cond(cond_type); 64 | #endif 65 | 66 | DLLExport thread_type Thread_start(thread_fn, void*); 67 | 68 | DLLExport mutex_type Thread_create_mutex(); 69 | DLLExport int Thread_lock_mutex(mutex_type); 70 | DLLExport int Thread_unlock_mutex(mutex_type); 71 | void Thread_destroy_mutex(mutex_type); 72 | 73 | DLLExport thread_id_type Thread_getid(); 74 | 75 | sem_type Thread_create_sem(void); 76 | int Thread_wait_sem(sem_type sem, int timeout); 77 | int Thread_check_sem(sem_type sem); 78 | int Thread_post_sem(sem_type sem); 79 | int Thread_destroy_sem(sem_type sem); 80 | 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/Types.typ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.26.0-rev.10/PahoMQTT/V4.26.0/Types.typ -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/VersionInfo.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _VERSIONINFO_H_ 3 | #define _VERSIONINFO_H_ 4 | #define BUILD_TIMESTAMP "2017-08-25" 5 | #define CLIENT_VERSION "1.2.0" 6 | #endif //_VERSIONINFO_H_ 7 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/ar/IA32/Package.pkg: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | libarsystem.a 6 | librtk_lib.a 7 | liboSSLv110_s.a 8 | 9 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/ar/IA32/libarsystem.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.26.0-rev.10/PahoMQTT/V4.26.0/ar/IA32/libarsystem.a -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/ar/IA32/liboSSLv110_s.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.26.0-rev.10/PahoMQTT/V4.26.0/ar/IA32/liboSSLv110_s.a -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/ar/IA32/librtk_lib.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.26.0-rev.10/PahoMQTT/V4.26.0/ar/IA32/librtk_lib.a -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/ar/Package.pkg: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | logger.h 6 | IA32 7 | 8 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/ar/logger.h: -------------------------------------------------------------------------------- 1 | #ifndef _ARLOGGER_H_ 2 | #define _ARLOGGER_H_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif 8 | #include 9 | 10 | #define AR_PAHOMQTT_VERSION "PahoMQTT version 4.26.0-rev.10" 11 | 12 | /*Public API*/ 13 | void ArPahoLoggerResetError(); 14 | char ArPahoLoggerGetError(); 15 | unsigned long ArPahoLoggerGetErrorCounter(); 16 | unsigned long ArPahoLoggerInit(); 17 | 18 | _BUR_PUBLIC void ArPahoLogError(const char *format, ...); 19 | _BUR_PUBLIC void ArPahoLogWarning(const char *format, ...); 20 | _BUR_PUBLIC void ArPahoLogInfo(const char *format, ...); 21 | _BUR_PUBLIC void ArPahoLogSuccess(const char *format, ...); 22 | 23 | /*Internal functions*/ 24 | void ArPahoLoggerSetLogLevel(unsigned char Level); 25 | void ArPahoLoggerSuccess(const char *logtext); 26 | void ArPahoLoggerInfo(const char *logtext); 27 | void ArPahoLoggerWarning(const char *logtext); 28 | void ArPahoLoggerError(const char *logtext); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.10/PahoMQTT/V4.26.0/utf-8.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | *******************************************************************************/ 16 | 17 | #if !defined(UTF8_H) 18 | #define UTF8_H 19 | 20 | int UTF8_validate(int len, const char *data); 21 | int UTF8_validateString(const char* string); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/Binary.lby: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Types.typ 6 | Constants.var 7 | PahoMQTT.fun 8 | Clients.h 9 | Heap.h 10 | LinkedList.h 11 | Log.h 12 | Messages.h 13 | MQTTClient.h 14 | MQTTClientPersistence.h 15 | MQTTPacket.h 16 | MQTTPacketOut.h 17 | MQTTPersistence.h 18 | MQTTPersistenceDefault.h 19 | MQTTProtocol.h 20 | MQTTProtocolClient.h 21 | MQTTProtocolOut.h 22 | Socket.h 23 | SocketBuffer.h 24 | SSLSocket.h 25 | StackTrace.h 26 | Thread.h 27 | Tree.h 28 | utf-8.h 29 | VersionInfo.h 30 | ar 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/Constants.var: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.26.0-rev.11/PahoMQTT/V4.26.0/Constants.var -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/Heap.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - use tree data structure instead of list 16 | *******************************************************************************/ 17 | 18 | 19 | #if !defined(HEAP_H) 20 | #define HEAP_H 21 | 22 | #if defined(HIGH_PERFORMANCE) 23 | #define NO_HEAP_TRACKING 1 24 | #endif 25 | 26 | #include 27 | #ifndef _SG4 28 | # include 29 | #endif 30 | #include 31 | 32 | #if !defined(NO_HEAP_TRACKING) 33 | /** 34 | * redefines malloc to use "mymalloc" so that heap allocation can be tracked 35 | * @param x the size of the item to be allocated 36 | * @return the pointer to the item allocated, or NULL 37 | */ 38 | #define malloc(x) mymalloc(__FILE__, __LINE__, x) 39 | 40 | /** 41 | * redefines realloc to use "myrealloc" so that heap allocation can be tracked 42 | * @param a the heap item to be reallocated 43 | * @param b the new size of the item 44 | * @return the new pointer to the heap item 45 | */ 46 | #define realloc(a, b) myrealloc(__FILE__, __LINE__, a, b) 47 | 48 | /** 49 | * redefines free to use "myfree" so that heap allocation can be tracked 50 | * @param x the size of the item to be freed 51 | */ 52 | #define free(x) myfree(__FILE__, __LINE__, x) 53 | 54 | #endif 55 | 56 | /** 57 | * Information about the state of the heap. 58 | */ 59 | typedef struct 60 | { 61 | size_t current_size; /**< current size of the heap in bytes */ 62 | size_t max_size; /**< max size the heap has reached in bytes */ 63 | } heap_info; 64 | 65 | 66 | void* mymalloc(char*, int, size_t size); 67 | void* myrealloc(char*, int, void* p, size_t size); 68 | void myfree(char*, int, void* p); 69 | 70 | void Heap_scan(FILE* file); 71 | int Heap_initialize(void); 72 | void Heap_terminate(void); 73 | heap_info* Heap_get_info(void); 74 | int HeapDump(FILE* file); 75 | int HeapDumpString(FILE* file, char* str); 76 | void* Heap_findItem(void* p); 77 | void Heap_unlink(char* file, int line, void* p); 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/Log.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - updates for the async client 16 | *******************************************************************************/ 17 | 18 | #if !defined(LOG_H) 19 | #define LOG_H 20 | 21 | /*BE 22 | map LOG_LEVELS 23 | { 24 | "TRACE_MAXIMUM" 1 25 | "TRACE_MEDIUM" 2 26 | "TRACE_MINIMUM" 3 27 | "TRACE_PROTOCOL" 4 28 | 29 | "ERROR" 5 30 | "SEVERE" 6 31 | "FATAL" 7 32 | } 33 | BE*/ 34 | 35 | enum LOG_LEVELS { 36 | INVALID_LEVEL = -1, 37 | TRACE_MAXIMUM = 1, 38 | TRACE_MEDIUM, 39 | TRACE_MINIMUM, 40 | TRACE_PROTOCOL, 41 | LOG_ERROR, 42 | LOG_SEVERE, 43 | LOG_FATAL, 44 | }; 45 | 46 | 47 | /*BE 48 | def trace_settings_type 49 | { 50 | n32 map LOG_LEVELS "trace_level" 51 | n32 dec "max_trace_entries" 52 | n32 dec "trace_output_level" 53 | } 54 | BE*/ 55 | typedef struct 56 | { 57 | enum LOG_LEVELS trace_level; /**< trace level */ 58 | int max_trace_entries; /**< max no of entries in the trace buffer */ 59 | enum LOG_LEVELS trace_output_level; /**< trace level to output to destination */ 60 | } trace_settings_type; 61 | 62 | extern trace_settings_type trace_settings; 63 | 64 | #define LOG_PROTOCOL TRACE_PROTOCOL 65 | 66 | #define TRACE_MAX TRACE_MAXIMUM 67 | #define TRACE_MED TRACE_MEDIUM 68 | #define TRACE_MIN TRACE_MINIMUM 69 | 70 | typedef struct 71 | { 72 | const char* name; 73 | const char* value; 74 | } Log_nameValue; 75 | 76 | int Log_initialize(Log_nameValue*); 77 | void Log_terminate(void); 78 | 79 | void Log(enum LOG_LEVELS, int, const char *, ...); 80 | void Log_stackTrace(enum LOG_LEVELS, int, int, int, const char*, int, int*); 81 | 82 | typedef void Log_traceCallback(enum LOG_LEVELS level, const char *message); 83 | void Log_setTraceCallback(Log_traceCallback* callback); 84 | void Log_setTraceLevel(enum LOG_LEVELS level); 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/MQTTPacketOut.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs, Allan Stockdill-Mander - SSL updates 16 | * Ian Craggs - MQTT 3.1.1 support 17 | *******************************************************************************/ 18 | 19 | #if !defined(MQTTPACKETOUT_H) 20 | #define MQTTPACKETOUT_H 21 | 22 | #include "MQTTPacket.h" 23 | 24 | int MQTTPacket_send_connect(Clients* client, int MQTTVersion); 25 | void* MQTTPacket_connack(unsigned char aHeader, char* data, size_t datalen); 26 | 27 | int MQTTPacket_send_pingreq(networkHandles* net, const char* clientID); 28 | 29 | int MQTTPacket_send_subscribe(List* topics, List* qoss, int msgid, int dup, networkHandles* net, const char* clientID); 30 | void* MQTTPacket_suback(unsigned char aHeader, char* data, size_t datalen); 31 | 32 | int MQTTPacket_send_unsubscribe(List* topics, int msgid, int dup, networkHandles* net, const char* clientID); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/MQTTPersistence.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - async client updates 16 | * Ian Craggs - fix for bug 432903 - queue persistence 17 | *******************************************************************************/ 18 | 19 | #if defined(__cplusplus) 20 | extern "C" { 21 | #endif 22 | 23 | #include "Clients.h" 24 | 25 | /** Stem of the key for a sent PUBLISH QoS1 or QoS2 */ 26 | #define PERSISTENCE_PUBLISH_SENT "s-" 27 | /** Stem of the key for a sent PUBREL */ 28 | #define PERSISTENCE_PUBREL "sc-" 29 | /** Stem of the key for a received PUBLISH QoS2 */ 30 | #define PERSISTENCE_PUBLISH_RECEIVED "r-" 31 | /** Stem of the key for an async client command */ 32 | #define PERSISTENCE_COMMAND_KEY "c-" 33 | /** Stem of the key for an async client message queue */ 34 | #define PERSISTENCE_QUEUE_KEY "q-" 35 | #define PERSISTENCE_MAX_KEY_LENGTH 8 36 | 37 | int MQTTPersistence_create(MQTTClient_persistence** per, int type, void* pcontext); 38 | int MQTTPersistence_initialize(Clients* c, const char* serverURI); 39 | int MQTTPersistence_close(Clients* c); 40 | int MQTTPersistence_clear(Clients* c); 41 | int MQTTPersistence_restore(Clients* c); 42 | void* MQTTPersistence_restorePacket(char* buffer, size_t buflen); 43 | void MQTTPersistence_insertInOrder(List* list, void* content, size_t size); 44 | int MQTTPersistence_put(int socket, char* buf0, size_t buf0len, int count, 45 | char** buffers, size_t* buflens, int htype, int msgId, int scr); 46 | int MQTTPersistence_remove(Clients* c, char* type, int qos, int msgId); 47 | void MQTTPersistence_wrapMsgID(Clients *c); 48 | 49 | typedef struct 50 | { 51 | char struct_id[4]; 52 | int struct_version; 53 | int payloadlen; 54 | void* payload; 55 | int qos; 56 | int retained; 57 | int dup; 58 | int msgid; 59 | } MQTTPersistence_message; 60 | 61 | typedef struct 62 | { 63 | MQTTPersistence_message* msg; 64 | char* topicName; 65 | int topicLen; 66 | unsigned int seqno; /* only used on restore */ 67 | } MQTTPersistence_qEntry; 68 | 69 | int MQTTPersistence_unpersistQueueEntry(Clients* client, MQTTPersistence_qEntry* qe); 70 | int MQTTPersistence_persistQueueEntry(Clients* aclient, MQTTPersistence_qEntry* qe); 71 | int MQTTPersistence_restoreMessageQueue(Clients* c); 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/MQTTPersistenceDefault.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | *******************************************************************************/ 16 | 17 | /** 8.3 filesystem */ 18 | #define MESSAGE_FILENAME_LENGTH 8 19 | /** Extension of the filename */ 20 | #define MESSAGE_FILENAME_EXTENSION ".msg" 21 | 22 | /* prototypes of the functions for the default file system persistence */ 23 | int pstopen(void** handle, const char* clientID, const char* serverURI, void* context); 24 | int pstclose(void* handle); 25 | int pstput(void* handle, char* key, int bufcount, char* buffers[], int buflens[]); 26 | int pstget(void* handle, char* key, char** buffer, int* buflen); 27 | int pstremove(void* handle, char* key); 28 | int pstkeys(void* handle, char*** keys, int* nkeys); 29 | int pstclear(void* handle); 30 | int pstcontainskey(void* handle, char* key); 31 | 32 | int pstmkdir(char *pPathname); 33 | 34 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/MQTTProtocol.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - MQTT 3.1.1 updates 16 | *******************************************************************************/ 17 | 18 | #if !defined(MQTTPROTOCOL_H) 19 | #define MQTTPROTOCOL_H 20 | 21 | #include "LinkedList.h" 22 | #include "MQTTPacket.h" 23 | #include "Clients.h" 24 | 25 | #define MAX_MSG_ID 65535 26 | #define MAX_CLIENTID_LEN 65535 27 | 28 | typedef struct 29 | { 30 | int socket; 31 | Publications* p; 32 | } pending_write; 33 | 34 | 35 | typedef struct 36 | { 37 | List publications; 38 | unsigned int msgs_received; 39 | unsigned int msgs_sent; 40 | List pending_writes; /* for qos 0 writes not complete */ 41 | } MQTTProtocol; 42 | 43 | 44 | #include "MQTTProtocolOut.h" 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/MQTTProtocolClient.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs, Allan Stockdill-Mander - SSL updates 16 | * Ian Craggs - MQTT 3.1.1 updates 17 | * Rong Xiang, Ian Craggs - C++ compatibility 18 | *******************************************************************************/ 19 | 20 | #if !defined(MQTTPROTOCOLCLIENT_H) 21 | #define MQTTPROTOCOLCLIENT_H 22 | 23 | #include "LinkedList.h" 24 | #include "MQTTPacket.h" 25 | #include "Log.h" 26 | #include "MQTTProtocol.h" 27 | #include "Messages.h" 28 | 29 | #define MAX_MSG_ID 65535 30 | #define MAX_CLIENTID_LEN 65535 31 | 32 | int MQTTProtocol_startPublish(Clients* pubclient, Publish* publish, int qos, int retained, Messages** m); 33 | Messages* MQTTProtocol_createMessage(Publish* publish, Messages** mm, int qos, int retained); 34 | Publications* MQTTProtocol_storePublication(Publish* publish, int* len); 35 | int messageIDCompare(void* a, void* b); 36 | int MQTTProtocol_assignMsgId(Clients* client); 37 | void MQTTProtocol_removePublication(Publications* p); 38 | void Protocol_processPublication(Publish* publish, Clients* client); 39 | 40 | int MQTTProtocol_handlePublishes(void* pack, int sock); 41 | int MQTTProtocol_handlePubacks(void* pack, int sock); 42 | int MQTTProtocol_handlePubrecs(void* pack, int sock); 43 | int MQTTProtocol_handlePubrels(void* pack, int sock); 44 | int MQTTProtocol_handlePubcomps(void* pack, int sock); 45 | 46 | void MQTTProtocol_closeSession(Clients* c, int sendwill); 47 | void MQTTProtocol_keepalive(time_t); 48 | void MQTTProtocol_retry(time_t, int, int); 49 | void MQTTProtocol_freeClient(Clients* client); 50 | void MQTTProtocol_emptyMessageList(List* msgList); 51 | void MQTTProtocol_freeMessageList(List* msgList); 52 | 53 | char* MQTTStrncpy(char *dest, const char* src, size_t num); 54 | char* MQTTStrdup(const char* src); 55 | #endif 56 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/MQTTProtocolOut.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2017 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs, Allan Stockdill-Mander - SSL updates 16 | * Ian Craggs - MQTT 3.1.1 support 17 | * Ian Craggs - SNI support 18 | *******************************************************************************/ 19 | 20 | #if !defined(MQTTPROTOCOLOUT_H) 21 | #define MQTTPROTOCOLOUT_H 22 | 23 | #if defined(_SG4) && !defined(OPENSSL) 24 | # define OPENSSL 25 | #endif 26 | 27 | #include "LinkedList.h" 28 | #include "MQTTPacket.h" 29 | #include "Clients.h" 30 | #include "Log.h" 31 | #include "Messages.h" 32 | #include "MQTTProtocol.h" 33 | #include "MQTTProtocolClient.h" 34 | 35 | #define DEFAULT_PORT 1883 36 | 37 | char* MQTTProtocol_addressPort(const char* uri, int* port); 38 | void MQTTProtocol_reconnect(const char* ip_address, Clients* client); 39 | #if defined(OPENSSL) 40 | int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int ssl, int MQTTVersion); 41 | #else 42 | int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int MQTTVersion); 43 | #endif 44 | int MQTTProtocol_handlePingresps(void* pack, int sock); 45 | int MQTTProtocol_subscribe(Clients* client, List* topics, List* qoss, int msgID); 46 | int MQTTProtocol_handleSubacks(void* pack, int sock); 47 | int MQTTProtocol_unsubscribe(Clients* client, List* topics, int msgID); 48 | int MQTTProtocol_handleUnsubacks(void* pack, int sock); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/Messages.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | *******************************************************************************/ 16 | 17 | #if !defined(MESSAGES_H) 18 | #define MESSAGES_H 19 | 20 | #include "Log.h" 21 | 22 | const char* Messages_get(int, enum LOG_LEVELS); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/SG4/PahoMQTT.br: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.26.0-rev.11/PahoMQTT/V4.26.0/SG4/PahoMQTT.br -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/SG4/libPahoMQTT.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.26.0-rev.11/PahoMQTT/V4.26.0/SG4/libPahoMQTT.a -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/SG4/libPahoMQTT_s.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.26.0-rev.11/PahoMQTT/V4.26.0/SG4/libPahoMQTT_s.a -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/SSLSocket.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2017 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs, Allan Stockdill-Mander - initial implementation 15 | * Ian Craggs - SNI support 16 | *******************************************************************************/ 17 | #if !defined(SSLSOCKET_H) 18 | #define SSLSOCKET_H 19 | 20 | #if defined(_SG4) && !defined(OPENSSL) 21 | # define OPENSSL 22 | #endif 23 | 24 | #if defined(_SG4) 25 | #define ssl_mutex_type unsigned long 26 | #elif defined(WIN32) || defined(WIN64) 27 | #define ssl_mutex_type HANDLE 28 | #else 29 | #include 30 | #include 31 | #define ssl_mutex_type pthread_mutex_t 32 | #endif 33 | 34 | #include 35 | #include "SocketBuffer.h" 36 | #include "Clients.h" 37 | 38 | #define URI_SSL "ssl://" 39 | 40 | /** if we should handle openssl initialization (bool_value == 1) or depend on it to be initalized externally (bool_value == 0) */ 41 | void SSLSocket_handleOpensslInit(int bool_value); 42 | 43 | int SSLSocket_initialize(void); 44 | void SSLSocket_terminate(void); 45 | int SSLSocket_setSocketForSSL(networkHandles* net, MQTTClient_SSLOptions* opts, char* hostname); 46 | 47 | int SSLSocket_getch(SSL* ssl, int socket, char* c); 48 | char *SSLSocket_getdata(SSL* ssl, int socket, size_t bytes, size_t* actual_len); 49 | 50 | int SSLSocket_close(networkHandles* net); 51 | int SSLSocket_putdatas(SSL* ssl, int socket, char* buf0, size_t buf0len, int count, char** buffers, size_t* buflens, int* frees); 52 | int SSLSocket_connect(SSL* ssl, int socket); 53 | 54 | int SSLSocket_getPendingRead(void); 55 | int SSLSocket_continueWrite(pending_writes* pw); 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/Thread.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2017 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial implementation 15 | * Ian Craggs, Allan Stockdill-Mander - async client updates 16 | * Ian Craggs - fix for bug #420851 17 | * Ian Craggs - change MacOS semaphore implementation 18 | *******************************************************************************/ 19 | #include "MQTTClient.h" 20 | 21 | #if !defined(THREAD_H) 22 | #define THREAD_H 23 | 24 | #if defined(_SG4) 25 | #define thread_type unsigned long 26 | #define thread_id_type unsigned long 27 | #define thread_return_type void 28 | typedef thread_return_type (*thread_fn)(unsigned long); 29 | #define mutex_type unsigned long 30 | #define cond_type unsigned long 31 | #define sem_type unsigned long 32 | #define WINAPI 33 | #elif defined(WIN32) || defined(WIN64) 34 | #include 35 | #define thread_type HANDLE 36 | #define thread_id_type DWORD 37 | #define thread_return_type DWORD 38 | #define thread_fn LPTHREAD_START_ROUTINE 39 | #define mutex_type HANDLE 40 | #define cond_type HANDLE 41 | #define sem_type HANDLE 42 | #else 43 | #include 44 | 45 | #define thread_type pthread_t 46 | #define thread_id_type pthread_t 47 | #define thread_return_type void* 48 | typedef thread_return_type (*thread_fn)(void*); 49 | #define mutex_type pthread_mutex_t* 50 | typedef struct { pthread_cond_t cond; pthread_mutex_t mutex; } cond_type_struct; 51 | typedef cond_type_struct *cond_type; 52 | #if defined(OSX) 53 | #include 54 | typedef dispatch_semaphore_t sem_type; 55 | #else 56 | #include 57 | typedef sem_t *sem_type; 58 | #endif 59 | 60 | cond_type Thread_create_cond(void); 61 | int Thread_signal_cond(cond_type); 62 | int Thread_wait_cond(cond_type condvar, int timeout); 63 | int Thread_destroy_cond(cond_type); 64 | #endif 65 | 66 | DLLExport thread_type Thread_start(thread_fn, void*); 67 | 68 | DLLExport mutex_type Thread_create_mutex(); 69 | DLLExport int Thread_lock_mutex(mutex_type); 70 | DLLExport int Thread_unlock_mutex(mutex_type); 71 | void Thread_destroy_mutex(mutex_type); 72 | 73 | DLLExport thread_id_type Thread_getid(); 74 | 75 | sem_type Thread_create_sem(void); 76 | int Thread_wait_sem(sem_type sem, int timeout); 77 | int Thread_check_sem(sem_type sem); 78 | int Thread_post_sem(sem_type sem); 79 | int Thread_destroy_sem(sem_type sem); 80 | 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/Types.typ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.26.0-rev.11/PahoMQTT/V4.26.0/Types.typ -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/VersionInfo.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _VERSIONINFO_H_ 3 | #define _VERSIONINFO_H_ 4 | #define BUILD_TIMESTAMP "2017-08-25" 5 | #define CLIENT_VERSION "1.2.0" 6 | #endif //_VERSIONINFO_H_ 7 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/ar/IA32/Package.pkg: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | libarsystem.a 6 | librtk_lib.a 7 | liboSSLv110_s.a 8 | 9 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/ar/IA32/libarsystem.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.26.0-rev.11/PahoMQTT/V4.26.0/ar/IA32/libarsystem.a -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/ar/IA32/liboSSLv110_s.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.26.0-rev.11/PahoMQTT/V4.26.0/ar/IA32/liboSSLv110_s.a -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/ar/IA32/librtk_lib.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.26.0-rev.11/PahoMQTT/V4.26.0/ar/IA32/librtk_lib.a -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/ar/Package.pkg: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | logger.h 6 | IA32 7 | 8 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/ar/logger.h: -------------------------------------------------------------------------------- 1 | #ifndef _ARLOGGER_H_ 2 | #define _ARLOGGER_H_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif 8 | #include 9 | 10 | #define AR_PAHOMQTT_VERSION "PahoMQTT version 4.26.0-rev.11" 11 | 12 | /*Public API*/ 13 | _BUR_PUBLIC void ArPahoLoggerResetError(); 14 | _BUR_PUBLIC char ArPahoLoggerGetError(); 15 | _BUR_PUBLIC unsigned long ArPahoLoggerGetErrorCounter(); 16 | _BUR_PUBLIC unsigned long ArPahoLoggerInit(); 17 | 18 | _BUR_PUBLIC void ArPahoLogError(const char *format, ...); 19 | _BUR_PUBLIC void ArPahoLogWarning(const char *format, ...); 20 | _BUR_PUBLIC void ArPahoLogInfo(const char *format, ...); 21 | _BUR_PUBLIC void ArPahoLogSuccess(const char *format, ...); 22 | 23 | /*Internal functions*/ 24 | void ArPahoLoggerSetLogLevel(unsigned char Level); 25 | void ArPahoLoggerSuccess(const char *logtext); 26 | void ArPahoLoggerInfo(const char *logtext); 27 | void ArPahoLoggerWarning(const char *logtext); 28 | void ArPahoLoggerError(const char *logtext); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /library/V4.26.0-rev.11/PahoMQTT/V4.26.0/utf-8.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | *******************************************************************************/ 16 | 17 | #if !defined(UTF8_H) 18 | #define UTF8_H 19 | 20 | int UTF8_validate(int len, const char *data); 21 | int UTF8_validateString(const char* string); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/Binary.lby: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Types.typ 6 | Constants.var 7 | PahoMQTT.fun 8 | Clients.h 9 | Heap.h 10 | LinkedList.h 11 | Log.h 12 | Messages.h 13 | MQTTClient.h 14 | MQTTClientPersistence.h 15 | MQTTPacket.h 16 | MQTTPacketOut.h 17 | MQTTPersistence.h 18 | MQTTPersistenceDefault.h 19 | MQTTProtocol.h 20 | MQTTProtocolClient.h 21 | MQTTProtocolOut.h 22 | Socket.h 23 | SocketBuffer.h 24 | SSLSocket.h 25 | StackTrace.h 26 | Thread.h 27 | Tree.h 28 | utf-8.h 29 | VersionInfo.h 30 | ar 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/Constants.var: -------------------------------------------------------------------------------- 1 | VAR CONSTANT 2 | 3 | END_VAR 4 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/Heap.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - use tree data structure instead of list 16 | *******************************************************************************/ 17 | 18 | 19 | #if !defined(HEAP_H) 20 | #define HEAP_H 21 | 22 | #if defined(HIGH_PERFORMANCE) 23 | #define NO_HEAP_TRACKING 1 24 | #endif 25 | 26 | #include 27 | #ifndef _SG4 28 | # include 29 | #endif 30 | #include 31 | 32 | #if !defined(NO_HEAP_TRACKING) 33 | /** 34 | * redefines malloc to use "mymalloc" so that heap allocation can be tracked 35 | * @param x the size of the item to be allocated 36 | * @return the pointer to the item allocated, or NULL 37 | */ 38 | #define malloc(x) mymalloc(__FILE__, __LINE__, x) 39 | 40 | /** 41 | * redefines realloc to use "myrealloc" so that heap allocation can be tracked 42 | * @param a the heap item to be reallocated 43 | * @param b the new size of the item 44 | * @return the new pointer to the heap item 45 | */ 46 | #define realloc(a, b) myrealloc(__FILE__, __LINE__, a, b) 47 | 48 | /** 49 | * redefines free to use "myfree" so that heap allocation can be tracked 50 | * @param x the size of the item to be freed 51 | */ 52 | #define free(x) myfree(__FILE__, __LINE__, x) 53 | 54 | #endif 55 | 56 | /** 57 | * Information about the state of the heap. 58 | */ 59 | typedef struct 60 | { 61 | size_t current_size; /**< current size of the heap in bytes */ 62 | size_t max_size; /**< max size the heap has reached in bytes */ 63 | } heap_info; 64 | 65 | 66 | void* mymalloc(char*, int, size_t size); 67 | void* myrealloc(char*, int, void* p, size_t size); 68 | void myfree(char*, int, void* p); 69 | 70 | void Heap_scan(FILE* file); 71 | int Heap_initialize(void); 72 | void Heap_terminate(void); 73 | heap_info* Heap_get_info(void); 74 | int HeapDump(FILE* file); 75 | int HeapDumpString(FILE* file, char* str); 76 | void* Heap_findItem(void* p); 77 | void Heap_unlink(char* file, int line, void* p); 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/Log.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - updates for the async client 16 | *******************************************************************************/ 17 | 18 | #if !defined(LOG_H) 19 | #define LOG_H 20 | 21 | /*BE 22 | map LOG_LEVELS 23 | { 24 | "TRACE_MAXIMUM" 1 25 | "TRACE_MEDIUM" 2 26 | "TRACE_MINIMUM" 3 27 | "TRACE_PROTOCOL" 4 28 | 29 | "ERROR" 5 30 | "SEVERE" 6 31 | "FATAL" 7 32 | } 33 | BE*/ 34 | 35 | enum LOG_LEVELS { 36 | INVALID_LEVEL = -1, 37 | TRACE_MAXIMUM = 1, 38 | TRACE_MEDIUM, 39 | TRACE_MINIMUM, 40 | TRACE_PROTOCOL, 41 | LOG_ERROR, 42 | LOG_SEVERE, 43 | LOG_FATAL, 44 | }; 45 | 46 | 47 | /*BE 48 | def trace_settings_type 49 | { 50 | n32 map LOG_LEVELS "trace_level" 51 | n32 dec "max_trace_entries" 52 | n32 dec "trace_output_level" 53 | } 54 | BE*/ 55 | typedef struct 56 | { 57 | enum LOG_LEVELS trace_level; /**< trace level */ 58 | int max_trace_entries; /**< max no of entries in the trace buffer */ 59 | enum LOG_LEVELS trace_output_level; /**< trace level to output to destination */ 60 | } trace_settings_type; 61 | 62 | extern trace_settings_type trace_settings; 63 | 64 | #define LOG_PROTOCOL TRACE_PROTOCOL 65 | 66 | #define TRACE_MAX TRACE_MAXIMUM 67 | #define TRACE_MED TRACE_MEDIUM 68 | #define TRACE_MIN TRACE_MINIMUM 69 | 70 | typedef struct 71 | { 72 | const char* name; 73 | const char* value; 74 | } Log_nameValue; 75 | 76 | int Log_initialize(Log_nameValue*); 77 | void Log_terminate(void); 78 | 79 | void Log(enum LOG_LEVELS, int, const char *, ...); 80 | void Log_stackTrace(enum LOG_LEVELS, int, int, int, const char*, int, int*); 81 | 82 | typedef void Log_traceCallback(enum LOG_LEVELS level, const char *message); 83 | void Log_setTraceCallback(Log_traceCallback* callback); 84 | void Log_setTraceLevel(enum LOG_LEVELS level); 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/MQTTPacketOut.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs, Allan Stockdill-Mander - SSL updates 16 | * Ian Craggs - MQTT 3.1.1 support 17 | *******************************************************************************/ 18 | 19 | #if !defined(MQTTPACKETOUT_H) 20 | #define MQTTPACKETOUT_H 21 | 22 | #include "MQTTPacket.h" 23 | 24 | int MQTTPacket_send_connect(Clients* client, int MQTTVersion); 25 | void* MQTTPacket_connack(unsigned char aHeader, char* data, size_t datalen); 26 | 27 | int MQTTPacket_send_pingreq(networkHandles* net, const char* clientID); 28 | 29 | int MQTTPacket_send_subscribe(List* topics, List* qoss, int msgid, int dup, networkHandles* net, const char* clientID); 30 | void* MQTTPacket_suback(unsigned char aHeader, char* data, size_t datalen); 31 | 32 | int MQTTPacket_send_unsubscribe(List* topics, int msgid, int dup, networkHandles* net, const char* clientID); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/MQTTPersistence.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - async client updates 16 | * Ian Craggs - fix for bug 432903 - queue persistence 17 | *******************************************************************************/ 18 | 19 | #if defined(__cplusplus) 20 | extern "C" { 21 | #endif 22 | 23 | #include "Clients.h" 24 | 25 | /** Stem of the key for a sent PUBLISH QoS1 or QoS2 */ 26 | #define PERSISTENCE_PUBLISH_SENT "s-" 27 | /** Stem of the key for a sent PUBREL */ 28 | #define PERSISTENCE_PUBREL "sc-" 29 | /** Stem of the key for a received PUBLISH QoS2 */ 30 | #define PERSISTENCE_PUBLISH_RECEIVED "r-" 31 | /** Stem of the key for an async client command */ 32 | #define PERSISTENCE_COMMAND_KEY "c-" 33 | /** Stem of the key for an async client message queue */ 34 | #define PERSISTENCE_QUEUE_KEY "q-" 35 | #define PERSISTENCE_MAX_KEY_LENGTH 8 36 | 37 | int MQTTPersistence_create(MQTTClient_persistence** per, int type, void* pcontext); 38 | int MQTTPersistence_initialize(Clients* c, const char* serverURI); 39 | int MQTTPersistence_close(Clients* c); 40 | int MQTTPersistence_clear(Clients* c); 41 | int MQTTPersistence_restore(Clients* c); 42 | void* MQTTPersistence_restorePacket(char* buffer, size_t buflen); 43 | void MQTTPersistence_insertInOrder(List* list, void* content, size_t size); 44 | int MQTTPersistence_put(int socket, char* buf0, size_t buf0len, int count, 45 | char** buffers, size_t* buflens, int htype, int msgId, int scr); 46 | int MQTTPersistence_remove(Clients* c, char* type, int qos, int msgId); 47 | void MQTTPersistence_wrapMsgID(Clients *c); 48 | 49 | typedef struct 50 | { 51 | char struct_id[4]; 52 | int struct_version; 53 | int payloadlen; 54 | void* payload; 55 | int qos; 56 | int retained; 57 | int dup; 58 | int msgid; 59 | } MQTTPersistence_message; 60 | 61 | typedef struct 62 | { 63 | MQTTPersistence_message* msg; 64 | char* topicName; 65 | int topicLen; 66 | unsigned int seqno; /* only used on restore */ 67 | } MQTTPersistence_qEntry; 68 | 69 | int MQTTPersistence_unpersistQueueEntry(Clients* client, MQTTPersistence_qEntry* qe); 70 | int MQTTPersistence_persistQueueEntry(Clients* aclient, MQTTPersistence_qEntry* qe); 71 | int MQTTPersistence_restoreMessageQueue(Clients* c); 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/MQTTPersistenceDefault.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | *******************************************************************************/ 16 | 17 | /** 8.3 filesystem */ 18 | #define MESSAGE_FILENAME_LENGTH 8 19 | /** Extension of the filename */ 20 | #define MESSAGE_FILENAME_EXTENSION ".msg" 21 | 22 | /* prototypes of the functions for the default file system persistence */ 23 | int pstopen(void** handle, const char* clientID, const char* serverURI, void* context); 24 | int pstclose(void* handle); 25 | int pstput(void* handle, char* key, int bufcount, char* buffers[], int buflens[]); 26 | int pstget(void* handle, char* key, char** buffer, int* buflen); 27 | int pstremove(void* handle, char* key); 28 | int pstkeys(void* handle, char*** keys, int* nkeys); 29 | int pstclear(void* handle); 30 | int pstcontainskey(void* handle, char* key); 31 | 32 | int pstmkdir(char *pPathname); 33 | 34 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/MQTTProtocol.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - MQTT 3.1.1 updates 16 | *******************************************************************************/ 17 | 18 | #if !defined(MQTTPROTOCOL_H) 19 | #define MQTTPROTOCOL_H 20 | 21 | #include "LinkedList.h" 22 | #include "MQTTPacket.h" 23 | #include "Clients.h" 24 | 25 | #define MAX_MSG_ID 65535 26 | #define MAX_CLIENTID_LEN 65535 27 | 28 | typedef struct 29 | { 30 | int socket; 31 | Publications* p; 32 | } pending_write; 33 | 34 | 35 | typedef struct 36 | { 37 | List publications; 38 | unsigned int msgs_received; 39 | unsigned int msgs_sent; 40 | List pending_writes; /* for qos 0 writes not complete */ 41 | } MQTTProtocol; 42 | 43 | 44 | #include "MQTTProtocolOut.h" 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/MQTTProtocolClient.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs, Allan Stockdill-Mander - SSL updates 16 | * Ian Craggs - MQTT 3.1.1 updates 17 | * Rong Xiang, Ian Craggs - C++ compatibility 18 | *******************************************************************************/ 19 | 20 | #if !defined(MQTTPROTOCOLCLIENT_H) 21 | #define MQTTPROTOCOLCLIENT_H 22 | 23 | #include "LinkedList.h" 24 | #include "MQTTPacket.h" 25 | #include "Log.h" 26 | #include "MQTTProtocol.h" 27 | #include "Messages.h" 28 | 29 | #define MAX_MSG_ID 65535 30 | #define MAX_CLIENTID_LEN 65535 31 | 32 | int MQTTProtocol_startPublish(Clients* pubclient, Publish* publish, int qos, int retained, Messages** m); 33 | Messages* MQTTProtocol_createMessage(Publish* publish, Messages** mm, int qos, int retained); 34 | Publications* MQTTProtocol_storePublication(Publish* publish, int* len); 35 | int messageIDCompare(void* a, void* b); 36 | int MQTTProtocol_assignMsgId(Clients* client); 37 | void MQTTProtocol_removePublication(Publications* p); 38 | void Protocol_processPublication(Publish* publish, Clients* client); 39 | 40 | int MQTTProtocol_handlePublishes(void* pack, int sock); 41 | int MQTTProtocol_handlePubacks(void* pack, int sock); 42 | int MQTTProtocol_handlePubrecs(void* pack, int sock); 43 | int MQTTProtocol_handlePubrels(void* pack, int sock); 44 | int MQTTProtocol_handlePubcomps(void* pack, int sock); 45 | 46 | void MQTTProtocol_closeSession(Clients* c, int sendwill); 47 | void MQTTProtocol_keepalive(time_t); 48 | void MQTTProtocol_retry(time_t, int, int); 49 | void MQTTProtocol_freeClient(Clients* client); 50 | void MQTTProtocol_emptyMessageList(List* msgList); 51 | void MQTTProtocol_freeMessageList(List* msgList); 52 | 53 | char* MQTTStrncpy(char *dest, const char* src, size_t num); 54 | char* MQTTStrdup(const char* src); 55 | #endif 56 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/MQTTProtocolOut.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2017 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs, Allan Stockdill-Mander - SSL updates 16 | * Ian Craggs - MQTT 3.1.1 support 17 | * Ian Craggs - SNI support 18 | *******************************************************************************/ 19 | 20 | #if !defined(MQTTPROTOCOLOUT_H) 21 | #define MQTTPROTOCOLOUT_H 22 | 23 | #if defined(_SG4) && !defined(OPENSSL) 24 | # define OPENSSL 25 | #endif 26 | 27 | #include "LinkedList.h" 28 | #include "MQTTPacket.h" 29 | #include "Clients.h" 30 | #include "Log.h" 31 | #include "Messages.h" 32 | #include "MQTTProtocol.h" 33 | #include "MQTTProtocolClient.h" 34 | 35 | #define DEFAULT_PORT 1883 36 | 37 | char* MQTTProtocol_addressPort(const char* uri, int* port); 38 | void MQTTProtocol_reconnect(const char* ip_address, Clients* client); 39 | #if defined(OPENSSL) 40 | int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int ssl, int MQTTVersion); 41 | #else 42 | int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int MQTTVersion); 43 | #endif 44 | int MQTTProtocol_handlePingresps(void* pack, int sock); 45 | int MQTTProtocol_subscribe(Clients* client, List* topics, List* qoss, int msgID); 46 | int MQTTProtocol_handleSubacks(void* pack, int sock); 47 | int MQTTProtocol_unsubscribe(Clients* client, List* topics, int msgID); 48 | int MQTTProtocol_handleUnsubacks(void* pack, int sock); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/Messages.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | *******************************************************************************/ 16 | 17 | #if !defined(MESSAGES_H) 18 | #define MESSAGES_H 19 | 20 | #include "Log.h" 21 | 22 | const char* Messages_get(int, enum LOG_LEVELS); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/PahoMQTT.fun: -------------------------------------------------------------------------------- 1 | 2 | FUNCTION_BLOCK PahoMQTT_Cyclic 3 | VAR_INPUT 4 | LoggerLevel : USINT; (*0: ERROR, 1: WARNING, 2: INFO, 3: SUCCESS, 4: TRACE*) 5 | Resume : BOOL; (*Start the main thread (if not already running)*) 6 | Suspend : BOOL; (*Pause the main thread from a system perspective, yield everything*) 7 | END_VAR 8 | VAR_OUTPUT 9 | Alive : BOOL; (*Check whether the SDK_Exit has been called to kill the thread.*) 10 | Running : BOOL; (*Main thread is running*) 11 | Status : UINT; (*Status from Rtk functions*) 12 | ErrorInfo : STRING[80]; (*Error message*) 13 | END_VAR 14 | VAR 15 | _LoggerLevel : USINT; 16 | _Resume : BOOL; 17 | _Suspend : BOOL; 18 | _inst : UDINT; 19 | END_VAR 20 | END_FUNCTION_BLOCK 21 | 22 | FUNCTION PahoMQTT_Exit : BOOL (*Kill the main thread, should be used in _EXIT*) 23 | END_FUNCTION 24 | 25 | FUNCTION PahoMQTT_Sleep : BOOL (*Sleep the main thread for a certain period of time (ms)*) 26 | VAR_INPUT 27 | Milliseconds : UDINT; 28 | END_VAR 29 | END_FUNCTION 30 | 31 | FUNCTION PahoMQTT_IsAlive : BOOL (*Check whether the SDK_Exit has been called to kill the thread. should be used inside the main while() loop, to disconnect properly if the task is retransferred*) 32 | END_FUNCTION 33 | 34 | FUNCTION_BLOCK PahoMQTT_Init 35 | VAR_INPUT 36 | EnableLogger : BOOL; (*Activate AR Logging: MQTT_LOG and enable ERROR messages*) 37 | MainThread : UDINT; (*Function pointer to main thread with following signature: void sample(UDINT param)*) 38 | ThreadParam : UDINT; (*Pointer to parameter (structure) passed to the main thread in param*) 39 | SuspendThread : BOOL; (*Create the main thread in suspended mode, that you can start it with PahoMQTT_Cyclic.Resume. Useful for debugging*) 40 | ThreadName : STRING[13]; (*Unique name of the main thread, required for multiple instances / clients on one target.*) 41 | END_VAR 42 | VAR_OUTPUT 43 | Done : BOOL; 44 | Error : BOOL; (*Error occured during initialization*) 45 | ErrorInfo : STRING[80]; (*Error message*) 46 | Status : UINT; (*Status from RtkCreateTask*) 47 | END_VAR 48 | END_FUNCTION_BLOCK 49 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/SG3/PahoMQTT.h: -------------------------------------------------------------------------------- 1 | /* Automation Studio generated header file */ 2 | /* Do not edit ! */ 3 | /* PahoMQTT 4.34.0 */ 4 | 5 | #ifndef _PAHOMQTT_ 6 | #define _PAHOMQTT_ 7 | #ifdef __cplusplus 8 | extern "C" 9 | { 10 | #endif 11 | #ifndef _PahoMQTT_VERSION 12 | #define _PahoMQTT_VERSION 4.34.0 13 | #endif 14 | 15 | #include 16 | 17 | #ifndef _BUR_PUBLIC 18 | #define _BUR_PUBLIC 19 | #endif 20 | #ifdef _SG4 21 | #include "AsIecCon.h" 22 | #include "AsHW.h" 23 | #include "AsETH.h" 24 | #include "FileIO.h" 25 | #include "AsHost.h" 26 | #include "ArEventLog.h" 27 | #include "sys_lib.h" 28 | #endif 29 | #ifdef _SG3 30 | #include "AsIecCon.h" 31 | #include "AsHW.h" 32 | #include "AsETH.h" 33 | #include "FileIO.h" 34 | #include "AsHost.h" 35 | #include "ArEventLog.h" 36 | #include "sys_lib.h" 37 | #endif 38 | #ifdef _SGC 39 | #include "AsIecCon.h" 40 | #include "AsHW.h" 41 | #include "AsETH.h" 42 | #include "FileIO.h" 43 | #include "AsHost.h" 44 | #include "ArEventLog.h" 45 | #include "sys_lib.h" 46 | #endif 47 | 48 | /* Datatypes and datatypes of function blocks */ 49 | typedef struct PahoMQTT_Cyclic 50 | { 51 | /* VAR_INPUT (analog) */ 52 | unsigned char LoggerLevel; 53 | /* VAR_OUTPUT (analog) */ 54 | unsigned short Status; 55 | plcstring ErrorInfo[81]; 56 | /* VAR (analog) */ 57 | unsigned char _LoggerLevel; 58 | unsigned long _inst; 59 | /* VAR_INPUT (digital) */ 60 | plcbit Resume; 61 | plcbit Suspend; 62 | /* VAR_OUTPUT (digital) */ 63 | plcbit Alive; 64 | plcbit Running; 65 | /* VAR (digital) */ 66 | plcbit _Resume; 67 | plcbit _Suspend; 68 | } PahoMQTT_Cyclic_typ; 69 | 70 | typedef struct PahoMQTT_Init 71 | { 72 | /* VAR_INPUT (analog) */ 73 | unsigned long MainThread; 74 | unsigned long ThreadParam; 75 | plcstring ThreadName[14]; 76 | /* VAR_OUTPUT (analog) */ 77 | plcstring ErrorInfo[81]; 78 | unsigned short Status; 79 | /* VAR_INPUT (digital) */ 80 | plcbit EnableLogger; 81 | plcbit SuspendThread; 82 | /* VAR_OUTPUT (digital) */ 83 | plcbit Done; 84 | plcbit Error; 85 | } PahoMQTT_Init_typ; 86 | 87 | 88 | 89 | /* Prototyping of functions and function blocks */ 90 | _BUR_PUBLIC void PahoMQTT_Cyclic(struct PahoMQTT_Cyclic* inst); 91 | _BUR_PUBLIC void PahoMQTT_Init(struct PahoMQTT_Init* inst); 92 | _BUR_PUBLIC plcbit PahoMQTT_Exit(void); 93 | _BUR_PUBLIC plcbit PahoMQTT_Sleep(unsigned long Milliseconds); 94 | _BUR_PUBLIC plcbit PahoMQTT_IsAlive(void); 95 | 96 | 97 | #ifdef __cplusplus 98 | }; 99 | #endif 100 | #endif /* _PAHOMQTT_ */ 101 | 102 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/SG4/Arm/PahoMQTT.br: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.10/PahoMQTT/V4.34.0/SG4/Arm/PahoMQTT.br -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/SG4/Arm/libPahoMQTT.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.10/PahoMQTT/V4.34.0/SG4/Arm/libPahoMQTT.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/SG4/Arm/libPahoMQTT_s.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.10/PahoMQTT/V4.34.0/SG4/Arm/libPahoMQTT_s.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/SG4/PahoMQTT.br: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.10/PahoMQTT/V4.34.0/SG4/PahoMQTT.br -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/SG4/PahoMQTT.h: -------------------------------------------------------------------------------- 1 | /* Automation Studio generated header file */ 2 | /* Do not edit ! */ 3 | /* PahoMQTT 4.34.0 */ 4 | 5 | #ifndef _PAHOMQTT_ 6 | #define _PAHOMQTT_ 7 | #ifdef __cplusplus 8 | extern "C" 9 | { 10 | #endif 11 | #ifndef _PahoMQTT_VERSION 12 | #define _PahoMQTT_VERSION 4.34.0 13 | #endif 14 | 15 | #include 16 | 17 | #ifndef _BUR_PUBLIC 18 | #define _BUR_PUBLIC 19 | #endif 20 | #ifdef _SG4 21 | #include "AsIecCon.h" 22 | #include "AsHW.h" 23 | #include "AsETH.h" 24 | #include "FileIO.h" 25 | #include "AsHost.h" 26 | #include "ArEventLog.h" 27 | #include "sys_lib.h" 28 | #endif 29 | #ifdef _SG3 30 | #include "AsIecCon.h" 31 | #include "AsHW.h" 32 | #include "AsETH.h" 33 | #include "FileIO.h" 34 | #include "AsHost.h" 35 | #include "ArEventLog.h" 36 | #include "sys_lib.h" 37 | #endif 38 | #ifdef _SGC 39 | #include "AsIecCon.h" 40 | #include "AsHW.h" 41 | #include "AsETH.h" 42 | #include "FileIO.h" 43 | #include "AsHost.h" 44 | #include "ArEventLog.h" 45 | #include "sys_lib.h" 46 | #endif 47 | 48 | /* Datatypes and datatypes of function blocks */ 49 | typedef struct PahoMQTT_Cyclic 50 | { 51 | /* VAR_INPUT (analog) */ 52 | unsigned char LoggerLevel; 53 | /* VAR_OUTPUT (analog) */ 54 | unsigned short Status; 55 | plcstring ErrorInfo[81]; 56 | /* VAR (analog) */ 57 | unsigned char _LoggerLevel; 58 | unsigned long _inst; 59 | /* VAR_INPUT (digital) */ 60 | plcbit Resume; 61 | plcbit Suspend; 62 | /* VAR_OUTPUT (digital) */ 63 | plcbit Alive; 64 | plcbit Running; 65 | /* VAR (digital) */ 66 | plcbit _Resume; 67 | plcbit _Suspend; 68 | } PahoMQTT_Cyclic_typ; 69 | 70 | typedef struct PahoMQTT_Init 71 | { 72 | /* VAR_INPUT (analog) */ 73 | unsigned long MainThread; 74 | unsigned long ThreadParam; 75 | plcstring ThreadName[14]; 76 | /* VAR_OUTPUT (analog) */ 77 | plcstring ErrorInfo[81]; 78 | unsigned short Status; 79 | /* VAR_INPUT (digital) */ 80 | plcbit EnableLogger; 81 | plcbit SuspendThread; 82 | /* VAR_OUTPUT (digital) */ 83 | plcbit Done; 84 | plcbit Error; 85 | } PahoMQTT_Init_typ; 86 | 87 | 88 | 89 | /* Prototyping of functions and function blocks */ 90 | _BUR_PUBLIC void PahoMQTT_Cyclic(struct PahoMQTT_Cyclic* inst); 91 | _BUR_PUBLIC void PahoMQTT_Init(struct PahoMQTT_Init* inst); 92 | _BUR_PUBLIC plcbit PahoMQTT_Exit(void); 93 | _BUR_PUBLIC plcbit PahoMQTT_Sleep(unsigned long Milliseconds); 94 | _BUR_PUBLIC plcbit PahoMQTT_IsAlive(void); 95 | 96 | 97 | #ifdef __cplusplus 98 | }; 99 | #endif 100 | #endif /* _PAHOMQTT_ */ 101 | 102 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/SG4/libPahoMQTT.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.10/PahoMQTT/V4.34.0/SG4/libPahoMQTT.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/SG4/libPahoMQTT_s.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.10/PahoMQTT/V4.34.0/SG4/libPahoMQTT_s.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/SGC/PahoMQTT.h: -------------------------------------------------------------------------------- 1 | /* Automation Studio generated header file */ 2 | /* Do not edit ! */ 3 | /* PahoMQTT 4.34.0 */ 4 | 5 | #ifndef _PAHOMQTT_ 6 | #define _PAHOMQTT_ 7 | #ifdef __cplusplus 8 | extern "C" 9 | { 10 | #endif 11 | #ifndef _PahoMQTT_VERSION 12 | #define _PahoMQTT_VERSION 4.34.0 13 | #endif 14 | 15 | #include 16 | 17 | #ifndef _BUR_PUBLIC 18 | #define _BUR_PUBLIC 19 | #endif 20 | #ifdef _SG4 21 | #include "AsIecCon.h" 22 | #include "AsHW.h" 23 | #include "AsETH.h" 24 | #include "FileIO.h" 25 | #include "AsHost.h" 26 | #include "ArEventLog.h" 27 | #include "sys_lib.h" 28 | #endif 29 | #ifdef _SG3 30 | #include "AsIecCon.h" 31 | #include "AsHW.h" 32 | #include "AsETH.h" 33 | #include "FileIO.h" 34 | #include "AsHost.h" 35 | #include "ArEventLog.h" 36 | #include "sys_lib.h" 37 | #endif 38 | #ifdef _SGC 39 | #include "AsIecCon.h" 40 | #include "AsHW.h" 41 | #include "AsETH.h" 42 | #include "FileIO.h" 43 | #include "AsHost.h" 44 | #include "ArEventLog.h" 45 | #include "sys_lib.h" 46 | #endif 47 | 48 | /* Datatypes and datatypes of function blocks */ 49 | typedef struct PahoMQTT_Cyclic 50 | { 51 | /* VAR_INPUT (analog) */ 52 | unsigned char LoggerLevel; 53 | /* VAR_OUTPUT (analog) */ 54 | unsigned short Status; 55 | plcstring ErrorInfo[81]; 56 | /* VAR (analog) */ 57 | unsigned char _LoggerLevel; 58 | unsigned long _inst; 59 | /* VAR_INPUT (digital) */ 60 | plcbit Resume; 61 | plcbit Suspend; 62 | /* VAR_OUTPUT (digital) */ 63 | plcbit Alive; 64 | plcbit Running; 65 | /* VAR (digital) */ 66 | plcbit _Resume; 67 | plcbit _Suspend; 68 | } PahoMQTT_Cyclic_typ; 69 | 70 | typedef struct PahoMQTT_Init 71 | { 72 | /* VAR_INPUT (analog) */ 73 | unsigned long MainThread; 74 | unsigned long ThreadParam; 75 | plcstring ThreadName[14]; 76 | /* VAR_OUTPUT (analog) */ 77 | plcstring ErrorInfo[81]; 78 | unsigned short Status; 79 | /* VAR_INPUT (digital) */ 80 | plcbit EnableLogger; 81 | plcbit SuspendThread; 82 | /* VAR_OUTPUT (digital) */ 83 | plcbit Done; 84 | plcbit Error; 85 | } PahoMQTT_Init_typ; 86 | 87 | 88 | 89 | /* Prototyping of functions and function blocks */ 90 | _BUR_PUBLIC void PahoMQTT_Cyclic(struct PahoMQTT_Cyclic* inst); 91 | _BUR_PUBLIC void PahoMQTT_Init(struct PahoMQTT_Init* inst); 92 | _BUR_PUBLIC plcbit PahoMQTT_Exit(void); 93 | _BUR_PUBLIC plcbit PahoMQTT_Sleep(unsigned long Milliseconds); 94 | _BUR_PUBLIC plcbit PahoMQTT_IsAlive(void); 95 | 96 | 97 | #ifdef __cplusplus 98 | }; 99 | #endif 100 | #endif /* _PAHOMQTT_ */ 101 | 102 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/SSLSocket.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2017 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs, Allan Stockdill-Mander - initial implementation 15 | * Ian Craggs - SNI support 16 | *******************************************************************************/ 17 | #if !defined(SSLSOCKET_H) 18 | #define SSLSOCKET_H 19 | 20 | #if defined(_SG4) && !defined(OPENSSL) 21 | # define OPENSSL 22 | #endif 23 | 24 | #if defined(_SG4) 25 | #define ssl_mutex_type unsigned long 26 | #elif defined(WIN32) || defined(WIN64) 27 | #define ssl_mutex_type HANDLE 28 | #else 29 | #include 30 | #include 31 | #define ssl_mutex_type pthread_mutex_t 32 | #endif 33 | 34 | #include 35 | #include "SocketBuffer.h" 36 | #include "Clients.h" 37 | 38 | #define URI_SSL "ssl://" 39 | 40 | /** if we should handle openssl initialization (bool_value == 1) or depend on it to be initalized externally (bool_value == 0) */ 41 | void SSLSocket_handleOpensslInit(int bool_value); 42 | 43 | int SSLSocket_initialize(void); 44 | void SSLSocket_terminate(void); 45 | int SSLSocket_setSocketForSSL(networkHandles* net, MQTTClient_SSLOptions* opts, char* hostname); 46 | 47 | int SSLSocket_getch(SSL* ssl, int socket, char* c); 48 | char *SSLSocket_getdata(SSL* ssl, int socket, size_t bytes, size_t* actual_len); 49 | 50 | int SSLSocket_close(networkHandles* net); 51 | int SSLSocket_putdatas(SSL* ssl, int socket, char* buf0, size_t buf0len, int count, char** buffers, size_t* buflens, int* frees); 52 | int SSLSocket_connect(SSL* ssl, int socket); 53 | 54 | int SSLSocket_getPendingRead(void); 55 | int SSLSocket_continueWrite(pending_writes* pw); 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/Thread.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2017 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial implementation 15 | * Ian Craggs, Allan Stockdill-Mander - async client updates 16 | * Ian Craggs - fix for bug #420851 17 | * Ian Craggs - change MacOS semaphore implementation 18 | *******************************************************************************/ 19 | #include "MQTTClient.h" 20 | 21 | #if !defined(THREAD_H) 22 | #define THREAD_H 23 | 24 | #if defined(_SG4) 25 | #define thread_type unsigned long 26 | #define thread_id_type unsigned long 27 | #define thread_return_type void 28 | typedef thread_return_type (*thread_fn)(unsigned long); 29 | #define mutex_type unsigned long 30 | #define cond_type unsigned long 31 | #define sem_type unsigned long 32 | #define WINAPI 33 | #elif defined(WIN32) || defined(WIN64) 34 | #include 35 | #define thread_type HANDLE 36 | #define thread_id_type DWORD 37 | #define thread_return_type DWORD 38 | #define thread_fn LPTHREAD_START_ROUTINE 39 | #define mutex_type HANDLE 40 | #define cond_type HANDLE 41 | #define sem_type HANDLE 42 | #else 43 | #include 44 | 45 | #define thread_type pthread_t 46 | #define thread_id_type pthread_t 47 | #define thread_return_type void* 48 | typedef thread_return_type (*thread_fn)(void*); 49 | #define mutex_type pthread_mutex_t* 50 | typedef struct { pthread_cond_t cond; pthread_mutex_t mutex; } cond_type_struct; 51 | typedef cond_type_struct *cond_type; 52 | #if defined(OSX) 53 | #include 54 | typedef dispatch_semaphore_t sem_type; 55 | #else 56 | #include 57 | typedef sem_t *sem_type; 58 | #endif 59 | 60 | cond_type Thread_create_cond(void); 61 | int Thread_signal_cond(cond_type); 62 | int Thread_wait_cond(cond_type condvar, int timeout); 63 | int Thread_destroy_cond(cond_type); 64 | #endif 65 | 66 | DLLExport thread_type Thread_start(thread_fn, void*); 67 | 68 | DLLExport mutex_type Thread_create_mutex(); 69 | DLLExport int Thread_lock_mutex(mutex_type); 70 | DLLExport int Thread_unlock_mutex(mutex_type); 71 | void Thread_destroy_mutex(mutex_type); 72 | 73 | DLLExport thread_id_type Thread_getid(); 74 | 75 | sem_type Thread_create_sem(void); 76 | int Thread_wait_sem(sem_type sem, int timeout); 77 | int Thread_check_sem(sem_type sem); 78 | int Thread_post_sem(sem_type sem); 79 | int Thread_destroy_sem(sem_type sem); 80 | 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/Types.typ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.10/PahoMQTT/V4.34.0/Types.typ -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/VersionInfo.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _VERSIONINFO_H_ 3 | #define _VERSIONINFO_H_ 4 | #define BUILD_TIMESTAMP "2017-08-25" 5 | #define CLIENT_VERSION "1.2.0" 6 | #endif //_VERSIONINFO_H_ 7 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/ar/ARM/Package.pkg: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | libarsystem.a 6 | librtk_lib.a 7 | liboSSLv110_s.a 8 | 9 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/ar/ARM/libarsystem.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.10/PahoMQTT/V4.34.0/ar/ARM/libarsystem.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/ar/ARM/liboSSLv110_s.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.10/PahoMQTT/V4.34.0/ar/ARM/liboSSLv110_s.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/ar/ARM/librtk_lib.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.10/PahoMQTT/V4.34.0/ar/ARM/librtk_lib.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/ar/IA32/Package.pkg: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | libarsystem.a 6 | librtk_lib.a 7 | liboSSLv110_s.a 8 | 9 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/ar/IA32/libarsystem.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.10/PahoMQTT/V4.34.0/ar/IA32/libarsystem.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/ar/IA32/liboSSLv110_s.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.10/PahoMQTT/V4.34.0/ar/IA32/liboSSLv110_s.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/ar/IA32/librtk_lib.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.10/PahoMQTT/V4.34.0/ar/IA32/librtk_lib.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/ar/Package.pkg: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | logger.h 6 | ARM 7 | IA32 8 | 9 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/ar/logger.h: -------------------------------------------------------------------------------- 1 | #ifndef _ARLOGGER_H_ 2 | #define _ARLOGGER_H_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif 8 | #include 9 | 10 | #define AR_PAHOMQTT_VERSION "PahoMQTT version 4.34.0-rev.10" 11 | 12 | /*Public API*/ 13 | void ArPahoLoggerResetError(); 14 | char ArPahoLoggerGetError(); 15 | unsigned long ArPahoLoggerGetErrorCounter(); 16 | unsigned long ArPahoLoggerInit(); 17 | 18 | _BUR_PUBLIC void ArPahoLogError(const char *format, ...); 19 | _BUR_PUBLIC void ArPahoLogWarning(const char *format, ...); 20 | _BUR_PUBLIC void ArPahoLogInfo(const char *format, ...); 21 | _BUR_PUBLIC void ArPahoLogSuccess(const char *format, ...); 22 | 23 | /*Internal functions*/ 24 | void ArPahoLoggerSetLogLevel(unsigned char Level); 25 | void ArPahoLoggerSuccess(const char *logtext); 26 | void ArPahoLoggerInfo(const char *logtext); 27 | void ArPahoLoggerWarning(const char *logtext); 28 | void ArPahoLoggerError(const char *logtext); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.10/PahoMQTT/V4.34.0/utf-8.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | *******************************************************************************/ 16 | 17 | #if !defined(UTF8_H) 18 | #define UTF8_H 19 | 20 | int UTF8_validate(int len, const char *data); 21 | int UTF8_validateString(const char* string); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/Binary.lby: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Types.typ 6 | Constants.var 7 | PahoMQTT.fun 8 | Clients.h 9 | Heap.h 10 | LinkedList.h 11 | Log.h 12 | Messages.h 13 | MQTTClient.h 14 | MQTTClientPersistence.h 15 | MQTTPacket.h 16 | MQTTPacketOut.h 17 | MQTTPersistence.h 18 | MQTTPersistenceDefault.h 19 | MQTTProtocol.h 20 | MQTTProtocolClient.h 21 | MQTTProtocolOut.h 22 | Socket.h 23 | SocketBuffer.h 24 | SSLSocket.h 25 | StackTrace.h 26 | Thread.h 27 | Tree.h 28 | utf-8.h 29 | VersionInfo.h 30 | ar 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/Constants.var: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.11/PahoMQTT/V4.34.0/Constants.var -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/Heap.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - use tree data structure instead of list 16 | *******************************************************************************/ 17 | 18 | 19 | #if !defined(HEAP_H) 20 | #define HEAP_H 21 | 22 | #if defined(HIGH_PERFORMANCE) 23 | #define NO_HEAP_TRACKING 1 24 | #endif 25 | 26 | #include 27 | #ifndef _SG4 28 | # include 29 | #endif 30 | #include 31 | 32 | #if !defined(NO_HEAP_TRACKING) 33 | /** 34 | * redefines malloc to use "mymalloc" so that heap allocation can be tracked 35 | * @param x the size of the item to be allocated 36 | * @return the pointer to the item allocated, or NULL 37 | */ 38 | #define malloc(x) mymalloc(__FILE__, __LINE__, x) 39 | 40 | /** 41 | * redefines realloc to use "myrealloc" so that heap allocation can be tracked 42 | * @param a the heap item to be reallocated 43 | * @param b the new size of the item 44 | * @return the new pointer to the heap item 45 | */ 46 | #define realloc(a, b) myrealloc(__FILE__, __LINE__, a, b) 47 | 48 | /** 49 | * redefines free to use "myfree" so that heap allocation can be tracked 50 | * @param x the size of the item to be freed 51 | */ 52 | #define free(x) myfree(__FILE__, __LINE__, x) 53 | 54 | #endif 55 | 56 | /** 57 | * Information about the state of the heap. 58 | */ 59 | typedef struct 60 | { 61 | size_t current_size; /**< current size of the heap in bytes */ 62 | size_t max_size; /**< max size the heap has reached in bytes */ 63 | } heap_info; 64 | 65 | 66 | void* mymalloc(char*, int, size_t size); 67 | void* myrealloc(char*, int, void* p, size_t size); 68 | void myfree(char*, int, void* p); 69 | 70 | void Heap_scan(FILE* file); 71 | int Heap_initialize(void); 72 | void Heap_terminate(void); 73 | heap_info* Heap_get_info(void); 74 | int HeapDump(FILE* file); 75 | int HeapDumpString(FILE* file, char* str); 76 | void* Heap_findItem(void* p); 77 | void Heap_unlink(char* file, int line, void* p); 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/Log.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - updates for the async client 16 | *******************************************************************************/ 17 | 18 | #if !defined(LOG_H) 19 | #define LOG_H 20 | 21 | /*BE 22 | map LOG_LEVELS 23 | { 24 | "TRACE_MAXIMUM" 1 25 | "TRACE_MEDIUM" 2 26 | "TRACE_MINIMUM" 3 27 | "TRACE_PROTOCOL" 4 28 | 29 | "ERROR" 5 30 | "SEVERE" 6 31 | "FATAL" 7 32 | } 33 | BE*/ 34 | 35 | enum LOG_LEVELS { 36 | INVALID_LEVEL = -1, 37 | TRACE_MAXIMUM = 1, 38 | TRACE_MEDIUM, 39 | TRACE_MINIMUM, 40 | TRACE_PROTOCOL, 41 | LOG_ERROR, 42 | LOG_SEVERE, 43 | LOG_FATAL, 44 | }; 45 | 46 | 47 | /*BE 48 | def trace_settings_type 49 | { 50 | n32 map LOG_LEVELS "trace_level" 51 | n32 dec "max_trace_entries" 52 | n32 dec "trace_output_level" 53 | } 54 | BE*/ 55 | typedef struct 56 | { 57 | enum LOG_LEVELS trace_level; /**< trace level */ 58 | int max_trace_entries; /**< max no of entries in the trace buffer */ 59 | enum LOG_LEVELS trace_output_level; /**< trace level to output to destination */ 60 | } trace_settings_type; 61 | 62 | extern trace_settings_type trace_settings; 63 | 64 | #define LOG_PROTOCOL TRACE_PROTOCOL 65 | 66 | #define TRACE_MAX TRACE_MAXIMUM 67 | #define TRACE_MED TRACE_MEDIUM 68 | #define TRACE_MIN TRACE_MINIMUM 69 | 70 | typedef struct 71 | { 72 | const char* name; 73 | const char* value; 74 | } Log_nameValue; 75 | 76 | int Log_initialize(Log_nameValue*); 77 | void Log_terminate(void); 78 | 79 | void Log(enum LOG_LEVELS, int, const char *, ...); 80 | void Log_stackTrace(enum LOG_LEVELS, int, int, int, const char*, int, int*); 81 | 82 | typedef void Log_traceCallback(enum LOG_LEVELS level, const char *message); 83 | void Log_setTraceCallback(Log_traceCallback* callback); 84 | void Log_setTraceLevel(enum LOG_LEVELS level); 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/MQTTPacketOut.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs, Allan Stockdill-Mander - SSL updates 16 | * Ian Craggs - MQTT 3.1.1 support 17 | *******************************************************************************/ 18 | 19 | #if !defined(MQTTPACKETOUT_H) 20 | #define MQTTPACKETOUT_H 21 | 22 | #include "MQTTPacket.h" 23 | 24 | int MQTTPacket_send_connect(Clients* client, int MQTTVersion); 25 | void* MQTTPacket_connack(unsigned char aHeader, char* data, size_t datalen); 26 | 27 | int MQTTPacket_send_pingreq(networkHandles* net, const char* clientID); 28 | 29 | int MQTTPacket_send_subscribe(List* topics, List* qoss, int msgid, int dup, networkHandles* net, const char* clientID); 30 | void* MQTTPacket_suback(unsigned char aHeader, char* data, size_t datalen); 31 | 32 | int MQTTPacket_send_unsubscribe(List* topics, int msgid, int dup, networkHandles* net, const char* clientID); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/MQTTPersistence.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - async client updates 16 | * Ian Craggs - fix for bug 432903 - queue persistence 17 | *******************************************************************************/ 18 | 19 | #if defined(__cplusplus) 20 | extern "C" { 21 | #endif 22 | 23 | #include "Clients.h" 24 | 25 | /** Stem of the key for a sent PUBLISH QoS1 or QoS2 */ 26 | #define PERSISTENCE_PUBLISH_SENT "s-" 27 | /** Stem of the key for a sent PUBREL */ 28 | #define PERSISTENCE_PUBREL "sc-" 29 | /** Stem of the key for a received PUBLISH QoS2 */ 30 | #define PERSISTENCE_PUBLISH_RECEIVED "r-" 31 | /** Stem of the key for an async client command */ 32 | #define PERSISTENCE_COMMAND_KEY "c-" 33 | /** Stem of the key for an async client message queue */ 34 | #define PERSISTENCE_QUEUE_KEY "q-" 35 | #define PERSISTENCE_MAX_KEY_LENGTH 8 36 | 37 | int MQTTPersistence_create(MQTTClient_persistence** per, int type, void* pcontext); 38 | int MQTTPersistence_initialize(Clients* c, const char* serverURI); 39 | int MQTTPersistence_close(Clients* c); 40 | int MQTTPersistence_clear(Clients* c); 41 | int MQTTPersistence_restore(Clients* c); 42 | void* MQTTPersistence_restorePacket(char* buffer, size_t buflen); 43 | void MQTTPersistence_insertInOrder(List* list, void* content, size_t size); 44 | int MQTTPersistence_put(int socket, char* buf0, size_t buf0len, int count, 45 | char** buffers, size_t* buflens, int htype, int msgId, int scr); 46 | int MQTTPersistence_remove(Clients* c, char* type, int qos, int msgId); 47 | void MQTTPersistence_wrapMsgID(Clients *c); 48 | 49 | typedef struct 50 | { 51 | char struct_id[4]; 52 | int struct_version; 53 | int payloadlen; 54 | void* payload; 55 | int qos; 56 | int retained; 57 | int dup; 58 | int msgid; 59 | } MQTTPersistence_message; 60 | 61 | typedef struct 62 | { 63 | MQTTPersistence_message* msg; 64 | char* topicName; 65 | int topicLen; 66 | unsigned int seqno; /* only used on restore */ 67 | } MQTTPersistence_qEntry; 68 | 69 | int MQTTPersistence_unpersistQueueEntry(Clients* client, MQTTPersistence_qEntry* qe); 70 | int MQTTPersistence_persistQueueEntry(Clients* aclient, MQTTPersistence_qEntry* qe); 71 | int MQTTPersistence_restoreMessageQueue(Clients* c); 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/MQTTPersistenceDefault.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | *******************************************************************************/ 16 | 17 | /** 8.3 filesystem */ 18 | #define MESSAGE_FILENAME_LENGTH 8 19 | /** Extension of the filename */ 20 | #define MESSAGE_FILENAME_EXTENSION ".msg" 21 | 22 | /* prototypes of the functions for the default file system persistence */ 23 | int pstopen(void** handle, const char* clientID, const char* serverURI, void* context); 24 | int pstclose(void* handle); 25 | int pstput(void* handle, char* key, int bufcount, char* buffers[], int buflens[]); 26 | int pstget(void* handle, char* key, char** buffer, int* buflen); 27 | int pstremove(void* handle, char* key); 28 | int pstkeys(void* handle, char*** keys, int* nkeys); 29 | int pstclear(void* handle); 30 | int pstcontainskey(void* handle, char* key); 31 | 32 | int pstmkdir(char *pPathname); 33 | 34 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/MQTTProtocol.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - MQTT 3.1.1 updates 16 | *******************************************************************************/ 17 | 18 | #if !defined(MQTTPROTOCOL_H) 19 | #define MQTTPROTOCOL_H 20 | 21 | #include "LinkedList.h" 22 | #include "MQTTPacket.h" 23 | #include "Clients.h" 24 | 25 | #define MAX_MSG_ID 65535 26 | #define MAX_CLIENTID_LEN 65535 27 | 28 | typedef struct 29 | { 30 | int socket; 31 | Publications* p; 32 | } pending_write; 33 | 34 | 35 | typedef struct 36 | { 37 | List publications; 38 | unsigned int msgs_received; 39 | unsigned int msgs_sent; 40 | List pending_writes; /* for qos 0 writes not complete */ 41 | } MQTTProtocol; 42 | 43 | 44 | #include "MQTTProtocolOut.h" 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/MQTTProtocolClient.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs, Allan Stockdill-Mander - SSL updates 16 | * Ian Craggs - MQTT 3.1.1 updates 17 | * Rong Xiang, Ian Craggs - C++ compatibility 18 | *******************************************************************************/ 19 | 20 | #if !defined(MQTTPROTOCOLCLIENT_H) 21 | #define MQTTPROTOCOLCLIENT_H 22 | 23 | #include "LinkedList.h" 24 | #include "MQTTPacket.h" 25 | #include "Log.h" 26 | #include "MQTTProtocol.h" 27 | #include "Messages.h" 28 | 29 | #define MAX_MSG_ID 65535 30 | #define MAX_CLIENTID_LEN 65535 31 | 32 | int MQTTProtocol_startPublish(Clients* pubclient, Publish* publish, int qos, int retained, Messages** m); 33 | Messages* MQTTProtocol_createMessage(Publish* publish, Messages** mm, int qos, int retained); 34 | Publications* MQTTProtocol_storePublication(Publish* publish, int* len); 35 | int messageIDCompare(void* a, void* b); 36 | int MQTTProtocol_assignMsgId(Clients* client); 37 | void MQTTProtocol_removePublication(Publications* p); 38 | void Protocol_processPublication(Publish* publish, Clients* client); 39 | 40 | int MQTTProtocol_handlePublishes(void* pack, int sock); 41 | int MQTTProtocol_handlePubacks(void* pack, int sock); 42 | int MQTTProtocol_handlePubrecs(void* pack, int sock); 43 | int MQTTProtocol_handlePubrels(void* pack, int sock); 44 | int MQTTProtocol_handlePubcomps(void* pack, int sock); 45 | 46 | void MQTTProtocol_closeSession(Clients* c, int sendwill); 47 | void MQTTProtocol_keepalive(time_t); 48 | void MQTTProtocol_retry(time_t, int, int); 49 | void MQTTProtocol_freeClient(Clients* client); 50 | void MQTTProtocol_emptyMessageList(List* msgList); 51 | void MQTTProtocol_freeMessageList(List* msgList); 52 | 53 | char* MQTTStrncpy(char *dest, const char* src, size_t num); 54 | char* MQTTStrdup(const char* src); 55 | #endif 56 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/MQTTProtocolOut.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2017 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs, Allan Stockdill-Mander - SSL updates 16 | * Ian Craggs - MQTT 3.1.1 support 17 | * Ian Craggs - SNI support 18 | *******************************************************************************/ 19 | 20 | #if !defined(MQTTPROTOCOLOUT_H) 21 | #define MQTTPROTOCOLOUT_H 22 | 23 | #if defined(_SG4) && !defined(OPENSSL) 24 | # define OPENSSL 25 | #endif 26 | 27 | #include "LinkedList.h" 28 | #include "MQTTPacket.h" 29 | #include "Clients.h" 30 | #include "Log.h" 31 | #include "Messages.h" 32 | #include "MQTTProtocol.h" 33 | #include "MQTTProtocolClient.h" 34 | 35 | #define DEFAULT_PORT 1883 36 | 37 | char* MQTTProtocol_addressPort(const char* uri, int* port); 38 | void MQTTProtocol_reconnect(const char* ip_address, Clients* client); 39 | #if defined(OPENSSL) 40 | int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int ssl, int MQTTVersion); 41 | #else 42 | int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int MQTTVersion); 43 | #endif 44 | int MQTTProtocol_handlePingresps(void* pack, int sock); 45 | int MQTTProtocol_subscribe(Clients* client, List* topics, List* qoss, int msgID); 46 | int MQTTProtocol_handleSubacks(void* pack, int sock); 47 | int MQTTProtocol_unsubscribe(Clients* client, List* topics, int msgID); 48 | int MQTTProtocol_handleUnsubacks(void* pack, int sock); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/Messages.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | *******************************************************************************/ 16 | 17 | #if !defined(MESSAGES_H) 18 | #define MESSAGES_H 19 | 20 | #include "Log.h" 21 | 22 | const char* Messages_get(int, enum LOG_LEVELS); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/SG4/Arm/PahoMQTT.br: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.11/PahoMQTT/V4.34.0/SG4/Arm/PahoMQTT.br -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/SG4/Arm/libPahoMQTT.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.11/PahoMQTT/V4.34.0/SG4/Arm/libPahoMQTT.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/SG4/Arm/libPahoMQTT_s.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.11/PahoMQTT/V4.34.0/SG4/Arm/libPahoMQTT_s.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/SG4/PahoMQTT.br: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.11/PahoMQTT/V4.34.0/SG4/PahoMQTT.br -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/SG4/libPahoMQTT.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.11/PahoMQTT/V4.34.0/SG4/libPahoMQTT.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/SG4/libPahoMQTT_s.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.11/PahoMQTT/V4.34.0/SG4/libPahoMQTT_s.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/SSLSocket.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2017 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs, Allan Stockdill-Mander - initial implementation 15 | * Ian Craggs - SNI support 16 | *******************************************************************************/ 17 | #if !defined(SSLSOCKET_H) 18 | #define SSLSOCKET_H 19 | 20 | #if defined(_SG4) && !defined(OPENSSL) 21 | # define OPENSSL 22 | #endif 23 | 24 | #if defined(_SG4) 25 | #define ssl_mutex_type unsigned long 26 | #elif defined(WIN32) || defined(WIN64) 27 | #define ssl_mutex_type HANDLE 28 | #else 29 | #include 30 | #include 31 | #define ssl_mutex_type pthread_mutex_t 32 | #endif 33 | 34 | #include 35 | #include "SocketBuffer.h" 36 | #include "Clients.h" 37 | 38 | #define URI_SSL "ssl://" 39 | 40 | /** if we should handle openssl initialization (bool_value == 1) or depend on it to be initalized externally (bool_value == 0) */ 41 | void SSLSocket_handleOpensslInit(int bool_value); 42 | 43 | int SSLSocket_initialize(void); 44 | void SSLSocket_terminate(void); 45 | int SSLSocket_setSocketForSSL(networkHandles* net, MQTTClient_SSLOptions* opts, char* hostname); 46 | 47 | int SSLSocket_getch(SSL* ssl, int socket, char* c); 48 | char *SSLSocket_getdata(SSL* ssl, int socket, size_t bytes, size_t* actual_len); 49 | 50 | int SSLSocket_close(networkHandles* net); 51 | int SSLSocket_putdatas(SSL* ssl, int socket, char* buf0, size_t buf0len, int count, char** buffers, size_t* buflens, int* frees); 52 | int SSLSocket_connect(SSL* ssl, int socket); 53 | 54 | int SSLSocket_getPendingRead(void); 55 | int SSLSocket_continueWrite(pending_writes* pw); 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/Thread.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2017 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial implementation 15 | * Ian Craggs, Allan Stockdill-Mander - async client updates 16 | * Ian Craggs - fix for bug #420851 17 | * Ian Craggs - change MacOS semaphore implementation 18 | *******************************************************************************/ 19 | #include "MQTTClient.h" 20 | 21 | #if !defined(THREAD_H) 22 | #define THREAD_H 23 | 24 | #if defined(_SG4) 25 | #define thread_type unsigned long 26 | #define thread_id_type unsigned long 27 | #define thread_return_type void 28 | typedef thread_return_type (*thread_fn)(unsigned long); 29 | #define mutex_type unsigned long 30 | #define cond_type unsigned long 31 | #define sem_type unsigned long 32 | #define WINAPI 33 | #elif defined(WIN32) || defined(WIN64) 34 | #include 35 | #define thread_type HANDLE 36 | #define thread_id_type DWORD 37 | #define thread_return_type DWORD 38 | #define thread_fn LPTHREAD_START_ROUTINE 39 | #define mutex_type HANDLE 40 | #define cond_type HANDLE 41 | #define sem_type HANDLE 42 | #else 43 | #include 44 | 45 | #define thread_type pthread_t 46 | #define thread_id_type pthread_t 47 | #define thread_return_type void* 48 | typedef thread_return_type (*thread_fn)(void*); 49 | #define mutex_type pthread_mutex_t* 50 | typedef struct { pthread_cond_t cond; pthread_mutex_t mutex; } cond_type_struct; 51 | typedef cond_type_struct *cond_type; 52 | #if defined(OSX) 53 | #include 54 | typedef dispatch_semaphore_t sem_type; 55 | #else 56 | #include 57 | typedef sem_t *sem_type; 58 | #endif 59 | 60 | cond_type Thread_create_cond(void); 61 | int Thread_signal_cond(cond_type); 62 | int Thread_wait_cond(cond_type condvar, int timeout); 63 | int Thread_destroy_cond(cond_type); 64 | #endif 65 | 66 | DLLExport thread_type Thread_start(thread_fn, void*); 67 | 68 | DLLExport mutex_type Thread_create_mutex(); 69 | DLLExport int Thread_lock_mutex(mutex_type); 70 | DLLExport int Thread_unlock_mutex(mutex_type); 71 | void Thread_destroy_mutex(mutex_type); 72 | 73 | DLLExport thread_id_type Thread_getid(); 74 | 75 | sem_type Thread_create_sem(void); 76 | int Thread_wait_sem(sem_type sem, int timeout); 77 | int Thread_check_sem(sem_type sem); 78 | int Thread_post_sem(sem_type sem); 79 | int Thread_destroy_sem(sem_type sem); 80 | 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/Types.typ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.11/PahoMQTT/V4.34.0/Types.typ -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/VersionInfo.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _VERSIONINFO_H_ 3 | #define _VERSIONINFO_H_ 4 | #define BUILD_TIMESTAMP "2017-08-25" 5 | #define CLIENT_VERSION "1.2.0" 6 | #endif //_VERSIONINFO_H_ 7 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/ar/ARM/Package.pkg: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | libarsystem.a 6 | librtk_lib.a 7 | liboSSLv110_s.a 8 | 9 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/ar/ARM/libarsystem.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.11/PahoMQTT/V4.34.0/ar/ARM/libarsystem.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/ar/ARM/liboSSLv110_s.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.11/PahoMQTT/V4.34.0/ar/ARM/liboSSLv110_s.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/ar/ARM/librtk_lib.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.11/PahoMQTT/V4.34.0/ar/ARM/librtk_lib.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/ar/IA32/Package.pkg: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | libarsystem.a 6 | librtk_lib.a 7 | liboSSLv110_s.a 8 | 9 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/ar/IA32/libarsystem.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.11/PahoMQTT/V4.34.0/ar/IA32/libarsystem.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/ar/IA32/liboSSLv110_s.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.11/PahoMQTT/V4.34.0/ar/IA32/liboSSLv110_s.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/ar/IA32/librtk_lib.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.34.0-rev.11/PahoMQTT/V4.34.0/ar/IA32/librtk_lib.a -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/ar/Package.pkg: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | logger.h 6 | ARM 7 | IA32 8 | 9 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/ar/logger.h: -------------------------------------------------------------------------------- 1 | #ifndef _ARLOGGER_H_ 2 | #define _ARLOGGER_H_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif 8 | #include 9 | 10 | #define AR_PAHOMQTT_VERSION "PahoMQTT version 4.34.0-rev.11" 11 | 12 | /*Public API*/ 13 | _BUR_PUBLIC void ArPahoLoggerResetError(); 14 | _BUR_PUBLIC char ArPahoLoggerGetError(); 15 | _BUR_PUBLIC unsigned long ArPahoLoggerGetErrorCounter(); 16 | _BUR_PUBLIC unsigned long ArPahoLoggerInit(); 17 | 18 | _BUR_PUBLIC void ArPahoLogError(const char *format, ...); 19 | _BUR_PUBLIC void ArPahoLogWarning(const char *format, ...); 20 | _BUR_PUBLIC void ArPahoLogInfo(const char *format, ...); 21 | _BUR_PUBLIC void ArPahoLogSuccess(const char *format, ...); 22 | 23 | /*Internal functions*/ 24 | void ArPahoLoggerSetLogLevel(unsigned char Level); 25 | void ArPahoLoggerSuccess(const char *logtext); 26 | void ArPahoLoggerInfo(const char *logtext); 27 | void ArPahoLoggerWarning(const char *logtext); 28 | void ArPahoLoggerError(const char *logtext); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /library/V4.34.0-rev.11/PahoMQTT/V4.34.0/utf-8.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | *******************************************************************************/ 16 | 17 | #if !defined(UTF8_H) 18 | #define UTF8_H 19 | 20 | int UTF8_validate(int len, const char *data); 21 | int UTF8_validateString(const char* string); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/Binary.lby: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Types.typ 6 | Constants.var 7 | PahoMQTT.fun 8 | Clients.h 9 | Heap.h 10 | LinkedList.h 11 | Log.h 12 | Messages.h 13 | MQTTClient.h 14 | MQTTClientPersistence.h 15 | MQTTPacket.h 16 | MQTTPacketOut.h 17 | MQTTPersistence.h 18 | MQTTPersistenceDefault.h 19 | MQTTProtocol.h 20 | MQTTProtocolClient.h 21 | MQTTProtocolOut.h 22 | Socket.h 23 | SocketBuffer.h 24 | SSLSocket.h 25 | StackTrace.h 26 | Thread.h 27 | Tree.h 28 | utf-8.h 29 | VersionInfo.h 30 | ar 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/Constants.var: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.45.0-rev.11/PahoMQTT/V4.45.0/Constants.var -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/Heap.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - use tree data structure instead of list 16 | *******************************************************************************/ 17 | 18 | 19 | #if !defined(HEAP_H) 20 | #define HEAP_H 21 | 22 | #if defined(HIGH_PERFORMANCE) 23 | #define NO_HEAP_TRACKING 1 24 | #endif 25 | 26 | #include 27 | #ifndef _SG4 28 | # include 29 | #endif 30 | #include 31 | 32 | #if !defined(NO_HEAP_TRACKING) 33 | /** 34 | * redefines malloc to use "mymalloc" so that heap allocation can be tracked 35 | * @param x the size of the item to be allocated 36 | * @return the pointer to the item allocated, or NULL 37 | */ 38 | #define malloc(x) mymalloc(__FILE__, __LINE__, x) 39 | 40 | /** 41 | * redefines realloc to use "myrealloc" so that heap allocation can be tracked 42 | * @param a the heap item to be reallocated 43 | * @param b the new size of the item 44 | * @return the new pointer to the heap item 45 | */ 46 | #define realloc(a, b) myrealloc(__FILE__, __LINE__, a, b) 47 | 48 | /** 49 | * redefines free to use "myfree" so that heap allocation can be tracked 50 | * @param x the size of the item to be freed 51 | */ 52 | #define free(x) myfree(__FILE__, __LINE__, x) 53 | 54 | #endif 55 | 56 | /** 57 | * Information about the state of the heap. 58 | */ 59 | typedef struct 60 | { 61 | size_t current_size; /**< current size of the heap in bytes */ 62 | size_t max_size; /**< max size the heap has reached in bytes */ 63 | } heap_info; 64 | 65 | 66 | void* mymalloc(char*, int, size_t size); 67 | void* myrealloc(char*, int, void* p, size_t size); 68 | void myfree(char*, int, void* p); 69 | 70 | void Heap_scan(FILE* file); 71 | int Heap_initialize(void); 72 | void Heap_terminate(void); 73 | heap_info* Heap_get_info(void); 74 | int HeapDump(FILE* file); 75 | int HeapDumpString(FILE* file, char* str); 76 | void* Heap_findItem(void* p); 77 | void Heap_unlink(char* file, int line, void* p); 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/Log.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - updates for the async client 16 | *******************************************************************************/ 17 | 18 | #if !defined(LOG_H) 19 | #define LOG_H 20 | 21 | /*BE 22 | map LOG_LEVELS 23 | { 24 | "TRACE_MAXIMUM" 1 25 | "TRACE_MEDIUM" 2 26 | "TRACE_MINIMUM" 3 27 | "TRACE_PROTOCOL" 4 28 | 29 | "ERROR" 5 30 | "SEVERE" 6 31 | "FATAL" 7 32 | } 33 | BE*/ 34 | 35 | enum LOG_LEVELS { 36 | INVALID_LEVEL = -1, 37 | TRACE_MAXIMUM = 1, 38 | TRACE_MEDIUM, 39 | TRACE_MINIMUM, 40 | TRACE_PROTOCOL, 41 | LOG_ERROR, 42 | LOG_SEVERE, 43 | LOG_FATAL, 44 | }; 45 | 46 | 47 | /*BE 48 | def trace_settings_type 49 | { 50 | n32 map LOG_LEVELS "trace_level" 51 | n32 dec "max_trace_entries" 52 | n32 dec "trace_output_level" 53 | } 54 | BE*/ 55 | typedef struct 56 | { 57 | enum LOG_LEVELS trace_level; /**< trace level */ 58 | int max_trace_entries; /**< max no of entries in the trace buffer */ 59 | enum LOG_LEVELS trace_output_level; /**< trace level to output to destination */ 60 | } trace_settings_type; 61 | 62 | extern trace_settings_type trace_settings; 63 | 64 | #define LOG_PROTOCOL TRACE_PROTOCOL 65 | 66 | #define TRACE_MAX TRACE_MAXIMUM 67 | #define TRACE_MED TRACE_MEDIUM 68 | #define TRACE_MIN TRACE_MINIMUM 69 | 70 | typedef struct 71 | { 72 | const char* name; 73 | const char* value; 74 | } Log_nameValue; 75 | 76 | int Log_initialize(Log_nameValue*); 77 | void Log_terminate(void); 78 | 79 | void Log(enum LOG_LEVELS, int, const char *, ...); 80 | void Log_stackTrace(enum LOG_LEVELS, int, int, int, const char*, int, int*); 81 | 82 | typedef void Log_traceCallback(enum LOG_LEVELS level, const char *message); 83 | void Log_setTraceCallback(Log_traceCallback* callback); 84 | void Log_setTraceLevel(enum LOG_LEVELS level); 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/MQTTPacketOut.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs, Allan Stockdill-Mander - SSL updates 16 | * Ian Craggs - MQTT 3.1.1 support 17 | *******************************************************************************/ 18 | 19 | #if !defined(MQTTPACKETOUT_H) 20 | #define MQTTPACKETOUT_H 21 | 22 | #include "MQTTPacket.h" 23 | 24 | int MQTTPacket_send_connect(Clients* client, int MQTTVersion); 25 | void* MQTTPacket_connack(unsigned char aHeader, char* data, size_t datalen); 26 | 27 | int MQTTPacket_send_pingreq(networkHandles* net, const char* clientID); 28 | 29 | int MQTTPacket_send_subscribe(List* topics, List* qoss, int msgid, int dup, networkHandles* net, const char* clientID); 30 | void* MQTTPacket_suback(unsigned char aHeader, char* data, size_t datalen); 31 | 32 | int MQTTPacket_send_unsubscribe(List* topics, int msgid, int dup, networkHandles* net, const char* clientID); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/MQTTPersistence.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - async client updates 16 | * Ian Craggs - fix for bug 432903 - queue persistence 17 | *******************************************************************************/ 18 | 19 | #if defined(__cplusplus) 20 | extern "C" { 21 | #endif 22 | 23 | #include "Clients.h" 24 | 25 | /** Stem of the key for a sent PUBLISH QoS1 or QoS2 */ 26 | #define PERSISTENCE_PUBLISH_SENT "s-" 27 | /** Stem of the key for a sent PUBREL */ 28 | #define PERSISTENCE_PUBREL "sc-" 29 | /** Stem of the key for a received PUBLISH QoS2 */ 30 | #define PERSISTENCE_PUBLISH_RECEIVED "r-" 31 | /** Stem of the key for an async client command */ 32 | #define PERSISTENCE_COMMAND_KEY "c-" 33 | /** Stem of the key for an async client message queue */ 34 | #define PERSISTENCE_QUEUE_KEY "q-" 35 | #define PERSISTENCE_MAX_KEY_LENGTH 8 36 | 37 | int MQTTPersistence_create(MQTTClient_persistence** per, int type, void* pcontext); 38 | int MQTTPersistence_initialize(Clients* c, const char* serverURI); 39 | int MQTTPersistence_close(Clients* c); 40 | int MQTTPersistence_clear(Clients* c); 41 | int MQTTPersistence_restore(Clients* c); 42 | void* MQTTPersistence_restorePacket(char* buffer, size_t buflen); 43 | void MQTTPersistence_insertInOrder(List* list, void* content, size_t size); 44 | int MQTTPersistence_put(int socket, char* buf0, size_t buf0len, int count, 45 | char** buffers, size_t* buflens, int htype, int msgId, int scr); 46 | int MQTTPersistence_remove(Clients* c, char* type, int qos, int msgId); 47 | void MQTTPersistence_wrapMsgID(Clients *c); 48 | 49 | typedef struct 50 | { 51 | char struct_id[4]; 52 | int struct_version; 53 | int payloadlen; 54 | void* payload; 55 | int qos; 56 | int retained; 57 | int dup; 58 | int msgid; 59 | } MQTTPersistence_message; 60 | 61 | typedef struct 62 | { 63 | MQTTPersistence_message* msg; 64 | char* topicName; 65 | int topicLen; 66 | unsigned int seqno; /* only used on restore */ 67 | } MQTTPersistence_qEntry; 68 | 69 | int MQTTPersistence_unpersistQueueEntry(Clients* client, MQTTPersistence_qEntry* qe); 70 | int MQTTPersistence_persistQueueEntry(Clients* aclient, MQTTPersistence_qEntry* qe); 71 | int MQTTPersistence_restoreMessageQueue(Clients* c); 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/MQTTPersistenceDefault.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | *******************************************************************************/ 16 | 17 | /** 8.3 filesystem */ 18 | #define MESSAGE_FILENAME_LENGTH 8 19 | /** Extension of the filename */ 20 | #define MESSAGE_FILENAME_EXTENSION ".msg" 21 | 22 | /* prototypes of the functions for the default file system persistence */ 23 | int pstopen(void** handle, const char* clientID, const char* serverURI, void* context); 24 | int pstclose(void* handle); 25 | int pstput(void* handle, char* key, int bufcount, char* buffers[], int buflens[]); 26 | int pstget(void* handle, char* key, char** buffer, int* buflen); 27 | int pstremove(void* handle, char* key); 28 | int pstkeys(void* handle, char*** keys, int* nkeys); 29 | int pstclear(void* handle); 30 | int pstcontainskey(void* handle, char* key); 31 | 32 | int pstmkdir(char *pPathname); 33 | 34 | -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/MQTTProtocol.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - MQTT 3.1.1 updates 16 | *******************************************************************************/ 17 | 18 | #if !defined(MQTTPROTOCOL_H) 19 | #define MQTTPROTOCOL_H 20 | 21 | #include "LinkedList.h" 22 | #include "MQTTPacket.h" 23 | #include "Clients.h" 24 | 25 | #define MAX_MSG_ID 65535 26 | #define MAX_CLIENTID_LEN 65535 27 | 28 | typedef struct 29 | { 30 | int socket; 31 | Publications* p; 32 | } pending_write; 33 | 34 | 35 | typedef struct 36 | { 37 | List publications; 38 | unsigned int msgs_received; 39 | unsigned int msgs_sent; 40 | List pending_writes; /* for qos 0 writes not complete */ 41 | } MQTTProtocol; 42 | 43 | 44 | #include "MQTTProtocolOut.h" 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/MQTTProtocolClient.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs, Allan Stockdill-Mander - SSL updates 16 | * Ian Craggs - MQTT 3.1.1 updates 17 | * Rong Xiang, Ian Craggs - C++ compatibility 18 | *******************************************************************************/ 19 | 20 | #if !defined(MQTTPROTOCOLCLIENT_H) 21 | #define MQTTPROTOCOLCLIENT_H 22 | 23 | #include "LinkedList.h" 24 | #include "MQTTPacket.h" 25 | #include "Log.h" 26 | #include "MQTTProtocol.h" 27 | #include "Messages.h" 28 | 29 | #define MAX_MSG_ID 65535 30 | #define MAX_CLIENTID_LEN 65535 31 | 32 | int MQTTProtocol_startPublish(Clients* pubclient, Publish* publish, int qos, int retained, Messages** m); 33 | Messages* MQTTProtocol_createMessage(Publish* publish, Messages** mm, int qos, int retained); 34 | Publications* MQTTProtocol_storePublication(Publish* publish, int* len); 35 | int messageIDCompare(void* a, void* b); 36 | int MQTTProtocol_assignMsgId(Clients* client); 37 | void MQTTProtocol_removePublication(Publications* p); 38 | void Protocol_processPublication(Publish* publish, Clients* client); 39 | 40 | int MQTTProtocol_handlePublishes(void* pack, int sock); 41 | int MQTTProtocol_handlePubacks(void* pack, int sock); 42 | int MQTTProtocol_handlePubrecs(void* pack, int sock); 43 | int MQTTProtocol_handlePubrels(void* pack, int sock); 44 | int MQTTProtocol_handlePubcomps(void* pack, int sock); 45 | 46 | void MQTTProtocol_closeSession(Clients* c, int sendwill); 47 | void MQTTProtocol_keepalive(time_t); 48 | void MQTTProtocol_retry(time_t, int, int); 49 | void MQTTProtocol_freeClient(Clients* client); 50 | void MQTTProtocol_emptyMessageList(List* msgList); 51 | void MQTTProtocol_freeMessageList(List* msgList); 52 | 53 | char* MQTTStrncpy(char *dest, const char* src, size_t num); 54 | char* MQTTStrdup(const char* src); 55 | #endif 56 | -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/MQTTProtocolOut.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2017 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs, Allan Stockdill-Mander - SSL updates 16 | * Ian Craggs - MQTT 3.1.1 support 17 | * Ian Craggs - SNI support 18 | *******************************************************************************/ 19 | 20 | #if !defined(MQTTPROTOCOLOUT_H) 21 | #define MQTTPROTOCOLOUT_H 22 | 23 | #if defined(_SG4) && !defined(OPENSSL) 24 | # define OPENSSL 25 | #endif 26 | 27 | #include "LinkedList.h" 28 | #include "MQTTPacket.h" 29 | #include "Clients.h" 30 | #include "Log.h" 31 | #include "Messages.h" 32 | #include "MQTTProtocol.h" 33 | #include "MQTTProtocolClient.h" 34 | 35 | #define DEFAULT_PORT 1883 36 | 37 | char* MQTTProtocol_addressPort(const char* uri, int* port); 38 | void MQTTProtocol_reconnect(const char* ip_address, Clients* client); 39 | #if defined(OPENSSL) 40 | int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int ssl, int MQTTVersion); 41 | #else 42 | int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int MQTTVersion); 43 | #endif 44 | int MQTTProtocol_handlePingresps(void* pack, int sock); 45 | int MQTTProtocol_subscribe(Clients* client, List* topics, List* qoss, int msgID); 46 | int MQTTProtocol_handleSubacks(void* pack, int sock); 47 | int MQTTProtocol_unsubscribe(Clients* client, List* topics, int msgID); 48 | int MQTTProtocol_handleUnsubacks(void* pack, int sock); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/Messages.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | *******************************************************************************/ 16 | 17 | #if !defined(MESSAGES_H) 18 | #define MESSAGES_H 19 | 20 | #include "Log.h" 21 | 22 | const char* Messages_get(int, enum LOG_LEVELS); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/SG4/Arm/libPahoMQTT.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.45.0-rev.11/PahoMQTT/V4.45.0/SG4/Arm/libPahoMQTT.a -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/SG4/Arm/libPahoMQTT_s.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.45.0-rev.11/PahoMQTT/V4.45.0/SG4/Arm/libPahoMQTT_s.a -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/SG4/PahoMQTT.br: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.45.0-rev.11/PahoMQTT/V4.45.0/SG4/PahoMQTT.br -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/SG4/libPahoMQTT.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.45.0-rev.11/PahoMQTT/V4.45.0/SG4/libPahoMQTT.a -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/SG4/libPahoMQTT_s.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.45.0-rev.11/PahoMQTT/V4.45.0/SG4/libPahoMQTT_s.a -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/SSLSocket.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2017 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs, Allan Stockdill-Mander - initial implementation 15 | * Ian Craggs - SNI support 16 | *******************************************************************************/ 17 | #if !defined(SSLSOCKET_H) 18 | #define SSLSOCKET_H 19 | 20 | #if defined(_SG4) && !defined(OPENSSL) 21 | # define OPENSSL 22 | #endif 23 | 24 | #if defined(_SG4) 25 | #define ssl_mutex_type unsigned long 26 | #elif defined(WIN32) || defined(WIN64) 27 | #define ssl_mutex_type HANDLE 28 | #else 29 | #include 30 | #include 31 | #define ssl_mutex_type pthread_mutex_t 32 | #endif 33 | 34 | #include 35 | #include "SocketBuffer.h" 36 | #include "Clients.h" 37 | 38 | #define URI_SSL "ssl://" 39 | 40 | /** if we should handle openssl initialization (bool_value == 1) or depend on it to be initalized externally (bool_value == 0) */ 41 | void SSLSocket_handleOpensslInit(int bool_value); 42 | 43 | int SSLSocket_initialize(void); 44 | void SSLSocket_terminate(void); 45 | int SSLSocket_setSocketForSSL(networkHandles* net, MQTTClient_SSLOptions* opts, char* hostname); 46 | 47 | int SSLSocket_getch(SSL* ssl, int socket, char* c); 48 | char *SSLSocket_getdata(SSL* ssl, int socket, size_t bytes, size_t* actual_len); 49 | 50 | int SSLSocket_close(networkHandles* net); 51 | int SSLSocket_putdatas(SSL* ssl, int socket, char* buf0, size_t buf0len, int count, char** buffers, size_t* buflens, int* frees); 52 | int SSLSocket_connect(SSL* ssl, int socket); 53 | 54 | int SSLSocket_getPendingRead(void); 55 | int SSLSocket_continueWrite(pending_writes* pw); 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/Thread.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2017 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial implementation 15 | * Ian Craggs, Allan Stockdill-Mander - async client updates 16 | * Ian Craggs - fix for bug #420851 17 | * Ian Craggs - change MacOS semaphore implementation 18 | *******************************************************************************/ 19 | #include "MQTTClient.h" 20 | 21 | #if !defined(THREAD_H) 22 | #define THREAD_H 23 | 24 | #if defined(_SG4) 25 | #define thread_type unsigned long 26 | #define thread_id_type unsigned long 27 | #define thread_return_type void 28 | typedef thread_return_type (*thread_fn)(unsigned long); 29 | #define mutex_type unsigned long 30 | #define cond_type unsigned long 31 | #define sem_type unsigned long 32 | #define WINAPI 33 | #elif defined(WIN32) || defined(WIN64) 34 | #include 35 | #define thread_type HANDLE 36 | #define thread_id_type DWORD 37 | #define thread_return_type DWORD 38 | #define thread_fn LPTHREAD_START_ROUTINE 39 | #define mutex_type HANDLE 40 | #define cond_type HANDLE 41 | #define sem_type HANDLE 42 | #else 43 | #include 44 | 45 | #define thread_type pthread_t 46 | #define thread_id_type pthread_t 47 | #define thread_return_type void* 48 | typedef thread_return_type (*thread_fn)(void*); 49 | #define mutex_type pthread_mutex_t* 50 | typedef struct { pthread_cond_t cond; pthread_mutex_t mutex; } cond_type_struct; 51 | typedef cond_type_struct *cond_type; 52 | #if defined(OSX) 53 | #include 54 | typedef dispatch_semaphore_t sem_type; 55 | #else 56 | #include 57 | typedef sem_t *sem_type; 58 | #endif 59 | 60 | cond_type Thread_create_cond(void); 61 | int Thread_signal_cond(cond_type); 62 | int Thread_wait_cond(cond_type condvar, int timeout); 63 | int Thread_destroy_cond(cond_type); 64 | #endif 65 | 66 | DLLExport thread_type Thread_start(thread_fn, void*); 67 | 68 | DLLExport mutex_type Thread_create_mutex(); 69 | DLLExport int Thread_lock_mutex(mutex_type); 70 | DLLExport int Thread_unlock_mutex(mutex_type); 71 | void Thread_destroy_mutex(mutex_type); 72 | 73 | DLLExport thread_id_type Thread_getid(); 74 | 75 | sem_type Thread_create_sem(void); 76 | int Thread_wait_sem(sem_type sem, int timeout); 77 | int Thread_check_sem(sem_type sem); 78 | int Thread_post_sem(sem_type sem); 79 | int Thread_destroy_sem(sem_type sem); 80 | 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/Types.typ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.45.0-rev.11/PahoMQTT/V4.45.0/Types.typ -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/VersionInfo.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _VERSIONINFO_H_ 3 | #define _VERSIONINFO_H_ 4 | #define BUILD_TIMESTAMP "2017-08-25" 5 | #define CLIENT_VERSION "1.2.0" 6 | #endif //_VERSIONINFO_H_ 7 | -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/ar/ARM/Package.pkg: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | libarsystem.a 6 | librtk_lib.a 7 | liboSSLv110_s.a 8 | 9 | -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/ar/ARM/libarsystem.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.45.0-rev.11/PahoMQTT/V4.45.0/ar/ARM/libarsystem.a -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/ar/ARM/liboSSLv110_s.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.45.0-rev.11/PahoMQTT/V4.45.0/ar/ARM/liboSSLv110_s.a -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/ar/ARM/librtk_lib.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.45.0-rev.11/PahoMQTT/V4.45.0/ar/ARM/librtk_lib.a -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/ar/IA32/Package.pkg: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | libarsystem.a 6 | librtk_lib.a 7 | liboSSLv110_s.a 8 | 9 | -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/ar/IA32/libarsystem.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.45.0-rev.11/PahoMQTT/V4.45.0/ar/IA32/libarsystem.a -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/ar/IA32/liboSSLv110_s.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.45.0-rev.11/PahoMQTT/V4.45.0/ar/IA32/liboSSLv110_s.a -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/ar/IA32/librtk_lib.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archive-br-automation-com/PahoMQTT_Library/15216b39eda6af14933daec35a25a90f970b0557/library/V4.45.0-rev.11/PahoMQTT/V4.45.0/ar/IA32/librtk_lib.a -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/ar/Package.pkg: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | logger.h 6 | ARM 7 | IA32 8 | 9 | -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/ar/logger.h: -------------------------------------------------------------------------------- 1 | #ifndef _ARLOGGER_H_ 2 | #define _ARLOGGER_H_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif 8 | #include 9 | 10 | #define AR_PAHOMQTT_VERSION "PahoMQTT version 4.45.0-rev.11" 11 | 12 | /*Public API*/ 13 | _BUR_PUBLIC void ArPahoLoggerResetError(); 14 | _BUR_PUBLIC char ArPahoLoggerGetError(); 15 | _BUR_PUBLIC unsigned long ArPahoLoggerGetErrorCounter(); 16 | _BUR_PUBLIC unsigned long ArPahoLoggerInit(); 17 | 18 | _BUR_PUBLIC void ArPahoLogError(const char *format, ...); 19 | _BUR_PUBLIC void ArPahoLogWarning(const char *format, ...); 20 | _BUR_PUBLIC void ArPahoLogInfo(const char *format, ...); 21 | _BUR_PUBLIC void ArPahoLogSuccess(const char *format, ...); 22 | 23 | /*Internal functions*/ 24 | void ArPahoLoggerSetLogLevel(unsigned char Level); 25 | void ArPahoLoggerSuccess(const char *logtext); 26 | void ArPahoLoggerInfo(const char *logtext); 27 | void ArPahoLoggerWarning(const char *logtext); 28 | void ArPahoLoggerError(const char *logtext); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /library/V4.45.0-rev.11/PahoMQTT/V4.45.0/utf-8.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | *******************************************************************************/ 16 | 17 | #if !defined(UTF8_H) 18 | #define UTF8_H 19 | 20 | int UTF8_validate(int len, const char *data); 21 | int UTF8_validateString(const char* string); 22 | 23 | #endif 24 | --------------------------------------------------------------------------------