ua_network_pubsub_mqtt.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  2. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
  3. *
  4. * Copyright 2018 (c) Fraunhofer IOSB (Author: Lukas Meling)
  5. */
  6. #ifndef UA_NETWORK_MQTT_H_
  7. #define UA_NETWORK_MQTT_H_
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. #include "open62541/plugin/pubsub.h"
  12. #include "open62541/network_tcp.h"
  13. /* mqtt network layer specific internal data */
  14. typedef struct {
  15. UA_NetworkAddressUrlDataType address;
  16. UA_UInt32 mqttRecvBufferSize;
  17. UA_UInt32 mqttSendBufferSize;
  18. uint8_t *mqttSendBuffer;
  19. uint8_t *mqttRecvBuffer;
  20. UA_String *mqttClientId;
  21. UA_Connection *connection;
  22. void * mqttClient;
  23. void (*callback)(UA_ByteString *encodedBuffer, UA_ByteString *topic);
  24. } UA_PubSubChannelDataMQTT;
  25. /* TODO:
  26. * will topic,
  27. * will message,
  28. * user name,
  29. * password,
  30. * keep alive
  31. * ssl: cert, flag
  32. */
  33. UA_PubSubTransportLayer
  34. UA_PubSubTransportLayerMQTT(void);
  35. #ifdef __cplusplus
  36. } // extern "C"
  37. #endif
  38. #endif /* UA_NETWORK_MQTT_H_ */