connect abstract method

void connect(
  1. String server,
  2. int port,
  3. String username,
  4. String password,
)

Method is used to connect to MQTT broker and start publishing position data. server MQTT broker server hostname or IP address. port MQTT broker server port. username MQTT broker username for authentication. password MQTT broker password for authentication.

Example:

// Connect to MQTT broker
// Server: MQTT broker hostname or IP address
// Port: MQTT broker port (typically 1883 for non-SSL, 8883 for SSL)
// Username: MQTT broker username for authentication
// Password: MQTT broker password for authentication
_mqttSession!.connect("mqtt.example.com", 1883, "username", "password");

Implementation

void connect(String server, int port, String username, String password);