\App\CloudModule\ModelsAzureManager

Tool for managing Azure IoT Hub

Summary

Methods
Properties
Constants
__construct()
createMqttInterface()
checkConnectionString()
parseConnectionString()
generateSasToken()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$configManager
N/A

Properties

$configManager

$configManager : \App\ConfigModule\Models\GenericManager

Type

normal — Generic configuration manager

Methods

__construct()

__construct(\App\ConfigModule\Models\GenericManager  $configManager) : mixed

Constructor

Parameters

\App\ConfigModule\Models\GenericManager $configManager

Generic config manager

Returns

mixed

createMqttInterface()

createMqttInterface(array  $values) : void

Creates a new MQTT interface

Parameters

array $values

Values from form

Throws

\App\CloudModule\Exceptions\InvalidConnectionStringException
\Nette\Utils\JsonException

checkConnectionString()

checkConnectionString(string  $connectionString) : void

Validates MS Azure IoT Hub Connection String for devices

Parameters

string $connectionString

MS Azure IoT Hub Connection String

Throws

\App\CloudModule\Exceptions\InvalidConnectionStringException

parseConnectionString()

parseConnectionString(string  $connectionString) : string[]

Parses Microsoft Azure IoT Hub connection string

Parameters

string $connectionString

MS Azure IoT Hub Connection string

Throws

\App\CloudModule\Exceptions\InvalidConnectionStringException

Returns

string[] —

Values from the connection string

generateSasToken()

generateSasToken(string  $resourceUri, string  $signingKey, string|null  $policyName = null, int  $expiresInMins = 525600) : string

Generates the shared access signature token

Parameters

string $resourceUri

URI prefix (by segment) of the endpoints that can be accessed with this token, starting with host name of the IoT hub (no protocol).

string $signingKey

Signing key

string|null $policyName

The name of the shared access policy to which this token refers. Absent if the token refers to device-registry credentials.

int $expiresInMins

Expiration in minutes

Returns

string —

MS Azure Shared access signature token