### MqttClient Class Overview Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttClient/clientIdentifier Provides an overview of the MqttClient class, listing its constructors, properties, methods, and operators. This serves as a central reference for understanding the capabilities of the MQTT client. ```dart ##### MqttClient class 1. Constructors 2. new 3. withPort 4. Properties 5. autoReconnect 6. averageCycleLatency 7. clientEventBus 8. clientIdentifier 9. connectionHandler 10. connectionMessage 11. connectionState 12. connectionStatus 13. connectTimeoutPeriod 14. disconnectOnNoResponsePeriod 15. hashCode 16. instantiationCorrect 17. keepAlive 18. keepAlivePeriod 19. lastCycleLatency 20. manuallyAcknowledgeQos1 21. messagesAwaitingManualAcknowledge 22. onAutoReconnect 23. onAutoReconnected 24. onConnected 25. onDisconnected 26. onFailedConnectionAttempt 27. onSubscribed 28. onSubscribeFail 29. onUnsubscribed 30. pingCallback 31. pongCallback 32. port 33. published 34. publishingManager 35. resubscribeOnAutoReconnect 36. runtimeType 37. server 38. socketTimeout 39. subscriptionsManager 40. updates 41. websocketProtocols 42. websocketProtocolString 43. Methods 44. acknowledgeQos1Message 45. checkCredentials 46. connect 47. disconnect 48. disconnectOnNoMessageSent 49. disconnectOnNoPingResponse 50. doAutoReconnect 51. getConnectMessage 52. getSubscriptionsStatus 53. getSubscriptionsStatusBySubscription 54. internalDisconnect 55. logging 56. noSuchMethod 57. publishMessage 58. resubscribe 59. setProtocolV31 60. setProtocolV311 61. subscribe 62. subscribeBatch 63. toString 64. unsubscribe 65. unsubscribeMulti 66. Operators 67. operator == ``` -------------------------------- ### startMessageIdentifier Constant Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MessageIdentifierDispenser/startMessageIdentifier-constant Defines the starting value for message identifiers in the mqtt_client package. This constant is an integer. ```dart static const int startMessageIdentifier = 1; ``` -------------------------------- ### MqttServerClient Overview Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_server_client Provides an overview of the MqttServerClient class within the mqtt_server_client library. ```dart class MqttServerClient ``` -------------------------------- ### MqttSubscribeVariableHeader getWriteLength Method Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttSubscribeVariableHeader/getWriteLength Gets the length of the write data when WriteTo will be called. This method is part of the MqttSubscribeVariableHeader class. ```dart @override int getWriteLength() => 2; ``` -------------------------------- ### MqttPublishMessage Payload Property Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttPublishMessage/payload Gets or sets the payload of the Mqtt Message. This is a getter/setter pair for the message payload. ```dart late MqttPublishPayload payload; ``` -------------------------------- ### MQTT Client Package Overview Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client Provides an overview of the mqtt_client package for Dart, enabling MQTT client communication. ```dart # mqtt_client library ``` -------------------------------- ### mqtt_client Library Overview Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/Subscription-class This section lists the main components of the mqtt_client library, including classes, enums, typedefs, constructors, properties, and methods. It serves as a high-level index for understanding the library's structure and capabilities. ```APIDOC mqtt_client Library Structure: Classes: - AsciiPayloadConverter - AutoReconnect - BatchSubscription - ConnectAckMessageAvailable - DisconnectOnNoMessageSent - DisconnectOnNoPingResponse - IMqttConnectionHandler - IPublishingManager - MessageAvailable - MessageIdentifierDispenser - MessageReceived - MqttByteBuffer - MqttCancellableAsyncSleep - MqttClient - MqttClientConnectionStatus - MqttClientConstants - MqttClientEnvironment - MqttClientPayloadBuilder - MqttClientTopicFilter - MqttConnectAckMessage - MqttConnectAckVariableHeader - MqttConnectFlags - MqttConnectionBase - MqttConnectionHandlerBase - MqttConnectionKeepAlive - MqttConnectMessage - MqttConnectPayload - MqttConnectVariableHeader - MqttDisconnectMessage - MqttEncoding - MqttHeader - MqttLogger - MqttMessage - MqttMessageFactory - MqttPayload - MqttPingRequestMessage - MqttPingResponseMessage - MqttPublishAckMessage - MqttPublishAckVariableHeader - MqttPublishCompleteMessage - MqttPublishCompleteVariableHeader - MqttPublishMessage - MqttPublishPayload - MqttPublishReceivedMessage - MqttPublishReceivedVariableHeader - MqttPublishReleaseMessage - MqttPublishReleaseVariableHeader - MqttPublishVariableHeader - MqttReceivedMessage - MqttSubscribeAckMessage - MqttSubscribeAckPayload - MqttSubscribeAckVariableHeader - MqttSubscribeMessage - MqttSubscribePayload - MqttSubscribeVariableHeader - MqttUnsubscribeAckMessage - MqttUnsubscribeAckVariableHeader - MqttUnsubscribeMessage - MqttUnsubscribePayload - MqttUnsubscribeVariableHeader - MqttUtilities - MqttVariableHeader - MultiUnsubscription - PassthruPayloadConverter - PayloadConverter - Protocol - PublicationTopic - PublishingManager - ReadWrapper - Resubscribe - Subscription - SubscriptionsManager - SubscriptionTopic - Topic Enums: - MqttConnectionState - MqttConnectReturnCode - MqttDisconnectionOrigin - MqttMessageType - MqttQos - MqttReadWriteFlags - MqttSubscriptionStatus Typedefs: - AutoReconnectCallback - AutoReconnectCompleteCallback - ConnectCallback - DisconnectCallback - FailedConnectionAttemptCallback - MessageCallbackFunction - PingCallback - PongCallback - SubscribeCallback - SubscribeFailCallback - UnsubscribeCallback Validation: - Exceptions: - ClientIdentifierException - ConnectionException - IncorrectInstantiationException - InvalidHeaderException - InvalidMessageException - InvalidPayloadSizeException - InvalidTopicException - NoConnectionException Constructors: - new: Constructor for MqttClient and related classes. Properties of MqttClient (example): - allTopics: Returns all subscribed topics. - batch: Manages batch subscriptions. - createdTime: Timestamp of client creation. - failedSubscriptions: List of failed subscriptions. - messageIdentifier: Current message identifier. - qos: Quality of Service level for publications. - subscriptions: Current active subscriptions. - topic: The topic filter for the client. - totalFailedSubscriptions: Count of failed subscriptions. - totalSucceededSubscriptions: Count of successful subscriptions. Methods of MqttClient (example): - deliverChanges: Delivers pending message changes. - noSuchMethod: Handles calls to undefined methods. - notifyChange: Notifies observers of changes. - updateBatchQos: Updates Quality of Service for batch subscriptions. Operators of MqttClient (example): - operator ==: Compares two MqttClient instances for equality. ``` -------------------------------- ### MqttPublishCompleteMessage variableHeader Property Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttPublishCompleteMessage/variableHeader Gets or sets the variable header contents. Contains extended metadata about the message. ```dart late MqttPublishCompleteVariableHeader variableHeader; ``` -------------------------------- ### mqtt_client Library Overview Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/Topic-class This section lists the main components of the mqtt_client library, including classes, enums, typedefs, constructors, properties, methods, operators, and static methods. It serves as a table of contents for the library's structure. ```APIDOC mqtt_client Library Components: Classes: AsciiPayloadConverter, AutoReconnect, BatchSubscription, ConnectAckMessageAvailable, DisconnectOnNoMessageSent, DisconnectOnNoPingResponse, IMqttConnectionHandler, IPublishingManager, MessageAvailable, MessageIdentifierDispenser, MessageReceived, MqttByteBuffer, MqttCancellableAsyncSleep, MqttClient, MqttClientConnectionStatus, MqttClientConstants, MqttClientEnvironment, MqttClientPayloadBuilder, MqttClientTopicFilter, MqttConnectAckMessage, MqttConnectAckVariableHeader, MqttConnectFlags, MqttConnectionBase, MqttConnectionHandlerBase, MqttConnectionKeepAlive, MqttConnectMessage, MqttConnectPayload, MqttConnectVariableHeader, MqttDisconnectMessage, MqttEncoding, MqttHeader, MqttLogger, MqttMessage, MqttMessageFactory, MqttPayload, MqttPingRequestMessage, MqttPingResponseMessage, MqttPublishAckMessage, MqttPublishAckVariableHeader, MqttPublishCompleteMessage, MqttPublishCompleteVariableHeader, MqttPublishMessage, MqttPublishPayload, MqttPublishReceivedMessage, MqttPublishReceivedVariableHeader, MqttPublishReleaseMessage, MqttPublishReleaseVariableHeader, MqttPublishVariableHeader, MqttReceivedMessage, MqttSubscribeAckMessage, MqttSubscribeAckPayload, MqttSubscribeAckVariableHeader, MqttSubscribeMessage, MqttSubscribePayload, MqttSubscribeVariableHeader, MqttUnsubscribeAckMessage, MqttUnsubscribeAckVariableHeader, MqttUnsubscribeMessage, MqttUnsubscribePayload, MqttUnsubscribeVariableHeader, MqttUtilities, MqttVariableHeader, MultiUnsubscription, PassthruPayloadConverter, PayloadConverter, Protocol, PublicationTopic, PublishingManager, ReadWrapper, Resubscribe, Subscription, SubscriptionsManager, SubscriptionTopic, Topic Enums: MqttConnectionState, MqttConnectReturnCode, MqttDisconnectionOrigin, MqttMessageType, MqttQos, MqttReadWriteFlags, MqttSubscriptionStatus Typedefs: AutoReconnectCallback, AutoReconnectCompleteCallback, ConnectCallback, DisconnectCallback, FailedConnectionAttemptCallback, MessageCallbackFunction, PingCallback, PongCallback, SubscribeCallback, SubscribeFailCallback, UnsubscribeCallback Validation: Exceptions: ClientIdentifierException, ConnectionException, IncorrectInstantiationException, InvalidHeaderException, InvalidMessageException, InvalidPayloadSizeException, InvalidTopicException, NoConnectionException Constructors: new (for MqttClient and other classes) Properties: hashCode, hasWildcards, rawTopic, runtimeType, topicFragments (for Topic class) Methods: noSuchMethod, toString (general methods) Operators: operator == (for equality checks) Static methods: validateMaxLength, validateMinLength (for Topic validation) Constants: maxTopicLength, multiWildcard, multiWildcardValidEnd, topicSeparator, wildcard (for Topic related constants) ``` -------------------------------- ### MqttHeader messageType Property Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttHeader/messageType Gets or sets the type of the MQTT message. This is a getter/setter pair for the messageType property. ```dart MqttMessageType? messageType; ``` -------------------------------- ### totalSucceededSubscriptions Property Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/Subscription/totalSucceededSubscriptions Gets the total number of succeeded batch subscriptions. This property is an integer representing the count of successful subscriptions. ```dart int get totalSucceededSubscriptions => succeededSubscriptions.length; ``` -------------------------------- ### Topic Class Overview Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/Topic/maxTopicLength-constant Provides an overview of the Topic class in the mqtt_client package, listing its constructors, properties, methods, operators, static methods, and constants. ```dart class Topic { // Constructors // new // Properties // hashCode // hasWildcards // rawTopic // runtimeType // topicFragments // Methods // noSuchMethod // toString // Operators // operator == // Static methods // validateMaxLength // validateMinLength // Constants // maxTopicLength // multiWildcard // multiWildcardValidEnd // topicSeparator // wildcard } ``` -------------------------------- ### General MQTT Utilities Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client General library wide utilities. ```dart MqttUtilities ``` -------------------------------- ### MqttUnsubscribeVariableHeader getWriteLength Method Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttUnsubscribeVariableHeader/getWriteLength Gets the length of the write data when WriteTo will be called. This method is part of the MqttUnsubscribeVariableHeader class. ```dart @override int getWriteLength() => 2; ``` -------------------------------- ### MqttServerWs2Connection Class Overview Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_server_client/MqttServerWs2Connection/connect Provides an overview of the MqttServerWs2Connection class, listing its constructors, properties, and methods. ```APIDOC MqttServerWs2Connection: Constructors: new fromConnect Properties: client clientEventBus context hashCode headers listeners messageStream onBadCertificate protocols readWrapper runtimeType socketOptions socketTimeout Methods: closeClient connect connectAuto disconnect disposeClient noSuchMethod onData onDone onError onListen send stopListening toString Operators: operator == ``` -------------------------------- ### MqttUnsubscribeMessage Payload Property Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttUnsubscribeMessage/payload Gets or sets the payload of the Mqtt Message. This is a getter/setter pair for the MqttUnsubscribePayload. ```dart late MqttUnsubscribePayload payload; ``` -------------------------------- ### MqttSubscribeMessage Payload Property Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttSubscribeMessage/payload Gets or sets the payload of the Mqtt Message. This is a getter/setter pair for the payload. ```dart late MqttSubscribePayload payload; ``` -------------------------------- ### MqttConnectionBase Class Overview Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttConnectionBase-class Provides an overview of the MqttConnectionBase class, its purpose as an abstract base class for MQTT client connections, and its implementers. ```APIDOC MqttConnectionBase class abstract The MQTT client connection base class Implementers * MqttBrowserConnection * MqttServerConnection ``` -------------------------------- ### mqtt_client Topic Class API Documentation Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/Topic/multiWildcard-constant API documentation for the Topic class in the mqtt_client package. Covers constructors, properties like rawTopic and topicFragments, methods, and operators including equality checks. ```APIDOC Topic Class: Constructors: new(String topic) Creates a new Topic instance. Parameters: topic: The topic string to parse. Properties: hashCode: The hash code for this object. hasWildcards: Returns true if the topic contains wildcards. rawTopic: The original topic string. runtimeType: A singleton instance of this type. topicFragments: A list of topic fragments. Methods: noSuchMethod(Invocation invocation) Invoked when a non-existent method or property is accessed. toString(): String A string representation of the object. Operators: operator ==(Object other) Checks for equality with another object. Static Methods: validateMaxLength(String topic) Validates if the topic length exceeds the maximum allowed. validateMinLength(String topic) Validates if the topic length is less than the minimum allowed. Constants: maxTopicLength: The maximum allowed length for a topic. multiWildcard: The multi-wildcard character ('#'). multiWildcardValidEnd: Indicates if the multi-wildcard is valid at the end of a topic. topicSeparator: The character used to separate topic levels ('/'). ``` -------------------------------- ### MqttSubscribeAckMessage Payload Property Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttSubscribeAckMessage/payload Gets or sets the payload of the Mqtt Message. This is a getter/setter pair for the MqttSubscribeAckPayload. ```dart late MqttSubscribeAckPayload payload; ``` -------------------------------- ### MqttConnectMessage Class Overview Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttConnectMessage/withProtocolVersion Provides an overview of the MqttConnectMessage class, listing its constructors, properties, and methods, including `withProtocolVersion`. ```APIDOC MqttConnectMessage class Constructors: - new - fromByteBuffer Properties: - hashCode - header - payload - runtimeType - variableHeader Methods: - authenticateAs - keepAliveFor - noSuchMethod - readFrom - startClean - toString - will - withClientIdentifier - withProtocolName - withProtocolVersion - withWillMessage - withWillQos - withWillRetain - withWillTopic - writeTo Operators: - operator == ``` -------------------------------- ### MqttPublishReleaseVariableHeader getWriteLength Method Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttPublishReleaseVariableHeader/getWriteLength Gets the length of the write data when WriteTo will be called. This method is part of the MqttPublishReleaseVariableHeader class. ```dart @override int getWriteLength() => 2; ``` -------------------------------- ### MqttPublishCompleteVariableHeader getWriteLength Method Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttPublishCompleteVariableHeader/getWriteLength Gets the length of the write data when WriteTo will be called. This method is part of the MqttPublishCompleteVariableHeader class. ```dart @override int getWriteLength() => 2; ``` -------------------------------- ### MQTT Topic Base Implementation Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client Provides the base implementation of an MQTT topic. ```dart Topic ``` -------------------------------- ### MqttCancellableAsyncSleep Class Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttCancellableAsyncSleep-class Provides support for cancellable asynchronous sleep operations. This class allows a sleep timer to be started and cancelled before it completes. ```dart class MqttCancellableAsyncSleep { // Constructor MqttCancellableAsyncSleep.new(int _timeout); // Properties int get timeout => _timeout; bool get isRunning => _isRunning; // Methods void cancel() { // Implementation to cancel the timer } Future sleep() { // Implementation to start the timer and sleep return Future.value(); } } ``` -------------------------------- ### MQTT Client Constructors Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttClient-class Details the constructors available for initializing an MQTT client instance, including the default constructor and methods for specifying a port. ```dart new withPort ``` -------------------------------- ### MqttUnsubscribeMessage variableHeader Property Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttUnsubscribeMessage/variableHeader Gets or sets the variable header contents of an MqttUnsubscribeMessage. The variable header contains extended metadata about the message. ```dart MqttUnsubscribeVariableHeader? variableHeader; // Getter/Setter pair MqttUnsubscribeVariableHeader? get variableHeader => _variableHeader; set variableHeader(MqttUnsubscribeVariableHeader? value) { _variableHeader = value; } ``` -------------------------------- ### MqttBrowserClient Class API Documentation Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_browser_client/MqttBrowserClient/MqttBrowserClient API documentation for the MqttBrowserClient class, outlining its constructors, properties, and methods for MQTT client operations. ```APIDOC MqttBrowserClient: Constructors: withPort(server: String, clientIdentifier: String, port: int, {maxConnectionAttempts: int}) Initializes a new instance of the MqttServerClient class using the supplied Mqtt Port. Parameters: server: The server hostname to connect to clientIdentifier: The client identifier to use to connect with port: The port to use maxConnectionAttempts: The maximum number of connection attempts (default: MqttClientConstants.defaultMaxConnectionAttempts) Properties: autoReconnect: bool averageCycleLatency: Duration clientEventBus: StreamController clientIdentifier: String connectionHandler: MqttConnectionHandlerBase connectionMessage: MqttConnectMessage connectionState: MqttConnectionState connectTimeoutPeriod: Duration disconnectOnNoResponsePeriod: Duration hashCode: int instantiationCorrect: bool keepAlive: int keepAlivePeriod: Duration lastCycleLatency: Duration manuallyAcknowledgeQos1: bool maxConnectionAttempts: int messagesAwaitingManualAcknowledge: int onAutoReconnect: Function onAutoReconnected: Function onConnected: Function onDisconnected: Function onFailedConnectionAttempt: Function onSubscribed: Function onSubscribeFail: Function onUnsubscribed: Function pingCallback: Function pongCallback: Function port: int published: Stream publishingManager: MqttPublishingManager resubscribeOnAutoReconnect: bool runtimeType: Type server: String socketTimeout: Duration subscriptionsManager: MqttSubscriptionsManager updates: Stream websocketProtocols: List websocketProtocolString: String Methods: acknowledgeQos1Message(MqttMessageId messageId) checkCredentials() connect(): Future disconnect(): Future disconnectOnNoMessageSent(Duration disconnectInterval): disconnectOnNoPingResponse(Duration disconnectInterval): doAutoReconnect(): Future getConnectMessage(): MqttConnectMessage getSubscriptionsStatus(): MqttSubscriptionsStatus getSubscriptionsStatusBySubscription(String topic): internalDisconnect(): Future logging(String message): noSuchMethod(Invocation invocation): dynamic publishMessage(String topic, MqttQualityOfService topicQos, ByteString payload, {bool retain = false}): MqttMessageId resubscribe(): Future setProtocolV31(): void setProtocolV311(): void subscribe(String topic, MqttQualityOfService qualityOfService): subscribeBatch(Map subscriptions): toString(): String unsubscribe(String topic): unsubscribeMulti(List topics): Operators: operator ==(other: dynamic): bool ``` -------------------------------- ### SubscriptionTopic Class Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/SubscriptionTopic-class Provides a detailed overview of the SubscriptionTopic class, including its inheritance, constructors, properties, methods, and operators. ```APIDOC SubscriptionTopic class * Object * Topic * SubscriptionTopic Constructors: SubscriptionTopic.new(String rawTopic) Creates a new instance of a rawTopic from a topic string. Properties: hashCode → int Serves as a hash function for a topics. no setter inherited hasWildcards → bool Returns true if there are any wildcards in the specified rawTopic, otherwise false. no setter inherited rawTopic ↔ String Raw topic getter/setter pair inherited runtimeType → Type A representation of the runtime type of the object. no setter inherited topicFragments ↔ List Topic fragments getter/setter pair inherited Methods: matches(PublicationTopic matcheeTopic) → bool Checks if the rawTopic matches the supplied rawTopic using the MQTT rawTopic matching rules. Returns true if the rawTopic matches based on the MQTT rawTopic matching rules, otherwise false. noSuchMethod(Invocation invocation) → dynamic Invoked when a nonexistent method or property is accessed. inherited toString() → String Returns a String representation of the topic. inherited Operators: operator ==(Object other) → bool Checks if one topic equals another topic exactly. inherited ``` -------------------------------- ### MqttUnsubscribeAckVariableHeader getWriteLength Method Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttUnsubscribeAckVariableHeader/getWriteLength Gets the length of the write data when WriteTo will be called. This method is part of the MqttUnsubscribeAckVariableHeader class in the mqtt_client package. ```dart @override int getWriteLength() => 2; ``` -------------------------------- ### MqttClient Class Overview Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttClient/subscriptionsManager Provides a comprehensive list of properties and methods available for the MqttClient class. This includes connection management, subscription handling, message publishing, and configuration options for MQTT communication. ```APIDOC MqttClient Class: Constructors: - new: Creates a new MqttClient instance. - withPort(int port): Creates a new MqttClient instance with a specified port. Properties: - autoReconnect: Boolean indicating if auto-reconnect is enabled. - averageCycleLatency: The average latency of the client's cycles. - clientEventBus: An event bus for client-related events. - clientIdentifier: The unique identifier for the MQTT client. - connectionHandler: The handler for managing the client connection. - connectionMessage: The message associated with the current connection. - connectionState: The current state of the client connection. - connectionStatus: The status of the client connection. - connectTimeoutPeriod: The timeout period for establishing a connection. - disconnectOnNoResponsePeriod: The period after which the client disconnects if no response is received. - hashCode: The hash code of the MqttClient instance. - instantiationCorrect: Indicates if the client was instantiated correctly. - keepAlive: The keep-alive interval for the MQTT connection. - keepAlivePeriod: The period for keep-alive messages. - lastCycleLatency: The latency of the last client cycle. - manuallyAcknowledgeQos1: Boolean indicating if QoS 1 messages are manually acknowledged. - messagesAwaitingManualAcknowledge: Count of messages awaiting manual acknowledgment. - onAutoReconnect: Callback for when auto-reconnect is triggered. - onAutoReconnected: Callback for when auto-reconnect is successful. - onConnected: Callback for when the client successfully connects. - onDisconnected: Callback for when the client disconnects. - onFailedConnectionAttempt: Callback for failed connection attempts. - onSubscribed: Callback for successful subscription. - onSubscribeFail: Callback for failed subscription attempts. - onUnsubscribed: Callback for successful unsubscription. - pingCallback: Callback for ping responses. - pongCallback: Callback for pong responses. - port: The port number for the MQTT connection. - published: A stream of published messages. - publishingManager: The manager for handling message publishing. - resubscribeOnAutoReconnect: Boolean indicating if subscriptions should be re-established on auto-reconnect. - runtimeType: The runtime type of the MqttClient instance. - server: The MQTT server address. - socketTimeout: The timeout for socket operations. - subscriptionsManager: Manages MQTT subscriptions. - updates: A stream of client updates. - websocketProtocols: List of supported WebSocket protocols. - websocketProtocolString: String representation of supported WebSocket protocols. Methods: - acknowledgeQos1Message(MqttMessage message): Acknowledges a QoS 1 message. - checkCredentials(): Checks the client's credentials. - connect(): Establishes a connection to the MQTT broker. - disconnect(): Disconnects the client from the MQTT broker. - disconnectOnNoMessageSent(): Disconnects if no message is sent within a period. - disconnectOnNoPingResponse(): Disconnects if no ping response is received. - doAutoReconnect(): Initiates the auto-reconnect process. - getConnectMessage(): Retrieves the connection message. - getSubscriptionsStatus(): Gets the status of all subscriptions. - getSubscriptionsStatusBySubscription(String subscription): Gets the status of a specific subscription. - internalDisconnect(int reasonCode, String reasonString): Performs an internal disconnection. - logging(String message): Logs a message. - noSuchMethod(Invocation invocation): Handles calls to non-existent methods. - publishMessage(String topic, MqttMessage message): Publishes a message to a topic. - resubscribe(): Resubscribes to topics. - setProtocolV31(): Sets the MQTT protocol version to 3.1. - setProtocolV311(): Sets the MQTT protocol version to 3.1.1. - subscribe(String topic, MqttQos qos): Subscribes to a topic with a specified QoS level. - subscribeBatch(List topics): Subscribes to multiple topics. - toString(): Returns a string representation of the MqttClient. - unsubscribe(String topic): Unsubscribes from a topic. - unsubscribeMulti(List topics): Unsubscribes from multiple topics. Operators: - operator ==(Object other): Compares the MqttClient instance with another object. ``` -------------------------------- ### MqttSubscribeMessage variableHeader Property Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttSubscribeMessage/variableHeader Gets or sets the variable header contents of the MqttSubscribeMessage. The variable header contains extended metadata about the message. ```dart MqttSubscribeVariableHeader? variableHeader; ``` -------------------------------- ### MqttPublishReceivedMessage variableHeader Property Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttPublishReceivedMessage/variableHeader Gets or sets the variable header contents of an MqttPublishReceivedMessage. The variable header contains extended metadata about the message. ```dart late MqttPublishReceivedVariableHeader variableHeader; ``` -------------------------------- ### MqttConnectionHandlerBase Class API Documentation Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttConnectionHandlerBase/connect Provides a comprehensive overview of the MqttConnectionHandlerBase class, including its constructors, properties, and methods. This documentation details the functionality and usage of each member within the class. ```APIDOC MqttConnectionHandlerBase: Constructors: new Properties: autoReconnectInProgress: bool clientEventBus: ClientEventBus connection: MqttConnection connectionMessage: MqttConnectMessage? connectionStatus: MqttClientConnectionStatus connectTimer: Timer? hashCode: int initialConnectionComplete: bool maxConnectionAttempts: int messageProcessorRegistry: MessageProcessorRegistry onAutoReconnect: Function? onAutoReconnected: Function? onBadCertificate: Function? onConnected: Function? onDisconnected: Function? onFailedConnectionAttempt: Function? port: int runtimeType: Type sentMessageCallbacks: Map server: String websocketHeaders: Map websocketProtocols: List Methods: autoReconnect() close() connect(String server, int port, MqttConnectMessage? message) connectAckProcessor() connectAckReceived(MqttConnectAckMessage message) disconnect() initialiseListeners() internalConnect(String server, int port, MqttConnectMessage? message) messageAvailable(MqttMessage message) noSuchMethod(Invocation invocation) registerForAllSentMessages(int messageIdentifier, Function(MqttMessage) callback) registerForMessage(int messageIdentifier, Function(MqttMessage) callback) sendMessage(MqttMessage message) stopListening() toString(): String unRegisterForAllSentMessages(int messageIdentifier) unRegisterForMessage(int messageIdentifier) Operators: operator ==(Object other): bool ``` -------------------------------- ### MqttPublishPayload.getWriteLength Method Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttPublishPayload/getWriteLength Gets the length of the payload in bytes when written to a stream. This method overrides the base implementation to return the length of the internal message. ```dart @override int getWriteLength() => message.length; ``` -------------------------------- ### MqttServerNormalConnection Class Overview Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_server_client/MqttServerNormalConnection/connect Provides an overview of the MqttServerNormalConnection class, listing its constructors, properties, and methods available in the mqtt_client package. ```APIDOC MqttServerNormalConnection class Constructors: new fromConnect Properties: client clientEventBus hashCode listeners messageStream readWrapper runtimeType socketOptions socketTimeout Methods: closeClient connect connectAuto disconnect disposeClient noSuchMethod onData onDone onError onListen send stopListening toString Operators: operator == ``` -------------------------------- ### MqttHeader qos property Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttHeader/qos Gets or sets the Quality of Service indicator for the message. This is a getter/setter pair for the MqttQos enum. ```dart MqttQos qos = MqttQos.atMostOnce; ``` -------------------------------- ### MqttBrowserClient API Documentation Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_browser_client/MqttBrowserClient/connect API documentation for the MqttBrowserClient class, detailing its constructors, properties, and methods for MQTT client operations in a browser environment. ```APIDOC MqttBrowserClient: Constructors: new withPort Properties: autoReconnect: bool averageCycleLatency: Duration clientEventBus: EventBus? clientIdentifier: String connectionHandler: SynchronousMqttConnectionHandler connectionMessage: MqttConnectMessage connectionState: MqttConnectionState connectionStatus: MqttClientConnectionStatus? connectTimeoutPeriod: Duration disconnectOnNoResponsePeriod: Duration hashCode: int instantiationCorrect: bool keepAlive: bool keepAlivePeriod: Duration lastCycleLatency: Duration manuallyAcknowledgeQos1: bool maxConnectionAttempts: int messagesAwaitingManualAcknowledge: int onAutoReconnect: Function? onAutoReconnected: Function? onConnected: Function? onDisconnected: Function? onFailedConnectionAttempt: Function? onSubscribed: Function? onSubscribeFail: Function? onUnsubscribed: Function? pingCallback: Function? pongCallback: Function? port: int published: Stream publishingManager: MqttPublishingManager resubscribeOnAutoReconnect: bool runtimeType: Type server: String socketTimeout: Duration subscriptionsManager: MqttSubscriptionsManager updates: Stream websocketProtocols: List websocketProtocolString: String Methods: acknowledgeQos1Message(MqttMessage message) checkCredentials() connect([String? username, String? password]) disconnect() disconnectOnNoMessageSent(DisconnectOnNoMessageSent event) disconnectOnNoPingResponse(DisconnectOnNoPingResponse event) doAutoReconnect() getConnectMessage(): MqttConnectMessage getSubscriptionsStatus(): List getSubscriptionsStatusBySubscription(MqttSubscription subscription): MqttSubscriptionStatus internalDisconnect() logging(String message) noSuchMethod(Invocation invocation): dynamic publishMessage(String topic, MqttQualityOfService qos, MqttMessage message, {bool retain = false, bool isQos2 = false}) resubscribe(List subscriptions) setProtocolV31() setProtocolV311() subscribe(String topic, MqttQualityOfService qos) subscribeBatch(List subscriptions) toString(): String unsubscribe(List topics) unsubscribeMulti(List subscriptions) Operators: operator ==(Object other): bool ``` -------------------------------- ### MqttConnectionBase Constructors Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttConnectionBase-class Details the constructors available for the MqttConnectionBase class, including the default constructor and a constructor for initializing a new connection. ```APIDOC MqttConnectionBase.new(EventBus? clientEventBus) Default constructor MqttConnectionBase.fromConnect(String server, int port, EventBus? clientEventBus) Initializes a new instance of the MqttConnection class. ``` -------------------------------- ### MqttConnectFlags getWriteLength Method Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttConnectFlags/getWriteLength Gets the length of data written when WriteTo is called for MqttConnectFlags. This is a static method within the MqttConnectFlags class. ```dart static int getWriteLength() => 1; ``` -------------------------------- ### MqttServerConnection Constructors Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_server_client/MqttServerConnection-class Details the constructors for MqttServerConnection, including the default constructor and a constructor for initializing from connection details. ```APIDOC MqttServerConnection.new(EventBus? clientEventBus, List socketOptions, Duration? socketTimeout) Default constructor MqttServerConnection.fromConnect(String server, int port, EventBus clientEventBus, List socketOptions, Duration? socketTimeout) Initializes a new instance of the MqttConnection class. ``` -------------------------------- ### MqttClient onSubscribeFail Getter Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttClient/onSubscribeFail Gets the current callback function that is executed when a subscription fails. This callback is of type SubscribeFailCallback. ```dart SubscribeFailCallback? get onSubscribeFail => _onSubscribeFail; ``` -------------------------------- ### MqttUnsubscribeAckMessage variableHeader Property Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttUnsubscribeAckMessage/variableHeader Gets or sets the variable header contents of the MqttUnsubscribeAckMessage. The variable header contains extended metadata about the message. ```dart late MqttUnsubscribeAckVariableHeader variableHeader; ``` -------------------------------- ### MqttConnectionHandlerBase Class Overview Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_client/MqttConnectionHandlerBase/connectionMessage Provides a comprehensive overview of the MqttConnectionHandlerBase class, including its constructors, properties, methods, and operators for managing MQTT client connections. ```APIDOC MqttConnectionHandlerBase class: Constructors: new Properties: autoReconnectInProgress: bool clientEventBus: MqttClientEventBus connection: MqttConnection connectionMessage: MqttConnectMessage? connectionStatus: MqttConnectionStatus connectTimer: Timer? hashCode: int initialConnectionComplete: bool maxConnectionAttempts: int messageProcessorRegistry: MqttMessageProcessorRegistry onAutoReconnect: void Function()? onAutoReconnected: void Function()? onBadCertificate: void Function(X509Certificate?)? onConnected: void Function()? onDisconnected: void Function()? onFailedConnectionAttempt: void Function(MqttConnectionException)? port: int runtimeType: Type sentMessageCallbacks: Map server: String websocketHeaders: Map websocketProtocols: List Methods: autoReconnect(): void close(): void connect(): void connectAckProcessor(): void connectAckReceived(): void disconnect(): void initialiseListeners(): void internalConnect(): void messageAvailable(): void noSuchMethod(Invocation invocation): dynamic registerForAllSentMessages(int messageId, MqttMessageCallback callback): void registerForMessage(MqttMessageType messageType, MqttMessageCallback callback): void sendMessage(MqttMessage message): int stopListening(): void toString(): String unRegisterForAllSentMessages(int messageId): void unRegisterForMessage(MqttMessageType messageType): void Operators: operator ==(Object other): bool ``` -------------------------------- ### Mqtt Client General Methods Source: https://pub.dev/documentation/mqtt_client/latest/mqtt_server_client/MqttServerClient-class Includes general utility methods like toString and noSuchMethod. ```APIDOC toString() → String A string representation of this object. noSuchMethod(Invocation invocation) → dynamic Invoked when a nonexistent method or property is accessed. ```