Commit 2c54e7dc authored by Roman Ondráček's avatar Roman Ondráček

Cloud: improve Hexio IoT Platform MQTT connection wizard

Signed-off-by: Roman Ondráček's avatarRoman Ondráček <ondracek.roman@centrum.cz>
parent 62204919
Pipeline #2117 passed with stages
in 12 minutes and 59 seconds
......@@ -56,6 +56,14 @@ class HexioFormFactory extends CloudFormFactory {
$form->addText('broker', 'broker')
->setRequired('messages.broker')
->setDefaultValue('connect.hexio.cloud');
$form->addText('ClientId', 'ClientId')
->setRequired('messages.ClientId');
$form->addText('TopicRequest', 'TopicRequest')
->setDefaultValue('Iqrf/DpaRequest')
->setRequired('messages.TopicRequest');
$form->addText('TopicResponse', 'TopicResponse')
->setDefaultValue('Iqrf/DpaResponse')
->setRequired('messages.TopicResponse');
$form->addText('username', 'username')
->setRequired('messages.username');
$form->addText('password', 'password')
......
......@@ -82,11 +82,11 @@ class HexioManager implements IManager {
$interface = [
'instance' => 'MqttMessagingHexio',
'BrokerAddr' => 'ssl://' . $values['broker'] . ':8883',
'ClientId' => 'IqrfDpaMessaging1',
'ClientId' => $values['ClientId'],
'Persistence' => 1,
'Qos' => 1,
'TopicRequest' => 'Iqrf/DpaRequest',
'TopicResponse' => 'Iqrf/DpaResponse',
'TopicRequest' => '{no-process}/' . preg_replace('/^\{no\-process\}\//', '', $values['TopicRequest']),
'TopicResponse' => $values['TopicResponse'],
'User' => $values['username'],
'Password' => $values['password'],
'EnabledSSL' => true,
......
......@@ -29,10 +29,16 @@ hexio:
form:
title: Hexio IoT Platform MQTT connection wizard
broker: MQTT broker address
ClientId: Client ID
TopicRequest: Topic for requests
TopicResponse: Topic for responses
username: Username
password: Password
messages:
broker: Please enter the MQTT broker address.
ClientId: Please enter client ID.
TopicRequest: Please enter topic for requests.
TopicResponse: Please enter topic for responses.
username: Please enter the username.
password: Please enter the password.
save: Save
......
......@@ -35,6 +35,9 @@ class HexioManagerTest extends CloudIntegrationTestCase {
*/
private $values = [
'broker' => 'connect.hexio.cloud',
'ClientId' => 'IqrfDpaMessaging1',
'TopicRequest' => 'Iqrf/DpaRequest',
'TopicResponse' => 'Iqrf/DpaResponse',
'username' => 'user',
'password' => 'pass',
];
......@@ -50,7 +53,7 @@ class HexioManagerTest extends CloudIntegrationTestCase {
'ClientId' => 'IqrfDpaMessaging1',
'Persistence' => 1,
'Qos' => 1,
'TopicRequest' => 'Iqrf/DpaRequest',
'TopicRequest' => '{no-process}/Iqrf/DpaRequest',
'TopicResponse' => 'Iqrf/DpaResponse',
'User' => 'user',
'Password' => 'pass',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment