mqtt_packet_map_topic (mqtt_packet_map v1.3.1)
View SourceMQTT packet encoder
Summary
Functions
Recombine a normalized topic to a single binary string.
Check if a topic is valid, the topic must have been normalized. All topic characters must be utf-8 and topic levels shouldn't contain + and # characters.
Normalize a topic to a list. Wildcards are replace by the atoms '+' and '#' (as used by the router).
Validate a topic, return the normalized topic if it is a valid topic or topic filter.
Validate a topic, return the normalized topic. Must not contain any wild cards.
Functions
-spec flatten_topic(mqtt_packet_map:mqtt_topic()) -> binary().
Recombine a normalized topic to a single binary string.
Check if a topic is valid, the topic must have been normalized. All topic characters must be utf-8 and topic levels shouldn't contain + and # characters.
-spec normalize_topic(mqtt_packet_map:mqtt_topic()) -> mqtt_packet_map:mqtt_topic().
Normalize a topic to a list. Wildcards are replace by the atoms '+' and '#' (as used by the router).
-spec validate_topic(mqtt_packet_map:mqtt_topic()) -> {ok, mqtt_packet_map:mqtt_topic()} | {error, invalid_topic}.
Validate a topic, return the normalized topic if it is a valid topic or topic filter.
-spec validate_topic_publish(mqtt_packet_map:mqtt_topic()) -> {ok, mqtt_packet_map:mqtt_topic()} | {error, invalid_topic}.
Validate a topic, return the normalized topic. Must not contain any wild cards.