(Master//Service)
 
(No difference)

Latest revision as of 06:53, 21 October 2017

Topics

  • Master/<Network ID>/Repeater - Repeater events
  • Master/<Network ID>/Session - Call Control events
  • Master/<Network ID>/Service - Application-level events
  • Master/<Network ID>/System - System events
  • Master/<Network ID>/Incoming/<Command | Message | Announce>/<Source ID>/<Destination ID> - Incoming queue of ServiceWrapper
  • Master/<Network ID>/Outgoing/<Message | Report>/<Source ID>/<Destination ID> - Outgoing queue of ServiceWrapper
  • Master/<Network ID>/Incoming/Data/<Source ID>/<Destination ID> - Incoming queue of DataBridge
  • Master/<Network ID>/Outgoing/Data/<Source ID>/<Destination ID> - Outgoing queue of DataBridge

Master/<Network ID>/Session

These are examples of send data <syntaxhighlight lang="javascript"> {

  1. "Event" : "Session-Start",
  2. "LinkName" : "Hytera Multi-Site Connect",
  3. "LinkType" : 1,
  4. "ContextID" : 204204,
  5. "SessionID" : "d8655c54-b0dd-11e5-8f29-52540019894c",
  6. "SessionType" : 17,
  7. "Slot" : 2,
  8. "SourceID" : 2042076,
  9. "DestinationID" : 5057,
  10. "Route" : "None"

}

{

  1. "Event" : "Session-Update",
  2. "LinkName" : "Hytera Multi-Site Connect",
  3. "LinkType" : 1,
  4. "ContextID" : 204204,
  5. "SessionID" : "d8655c54-b0dd-11e5-8f29-52540019894c",
  6. "SessionType" : 9,
  7. "Slot" : 2,
  8. "SourceID" : 2042076,
  9. "DestinationID" : 5057,
  10. "Route" : "A0"

}

{

  1. "Event" : "Signal-Strength",
  2. "SessionID" : "26ddaf9e-b0de-11e5-8f29-52540019894c",
  3. "Strength" : -83.00

}

{

  1. "Event" : "Session-Stop",
  2. "LinkName" : "Hytera Multi-Site Connect",
  3. "LinkType" : 1,
  4. "ContextID" : 204101,
  5. "SessionID" : "26ddaf9e-b0de-11e5-8f29-52540019894c",
  6. "SessionType" : 9,
  7. "Slot" : 1,
  8. "SourceID" : 2042036,
  9. "DestinationID" : 5059,
  10. "State" : 2,
  11. "DataCount" : 4

}

{

  1. "Event" : "Loss-Rate",
  2. "SessionID" : "26ddaf9e-b0de-11e5-8f29-52540019894c",
  3. "LossCount" : 0,
  4. "TotalCount" : 5

} </syntaxhighlight>

Master/<Network ID>/Service

These are examples of send data <syntaxhighlight lang="javascript"> { "Event" : "Registration", "RegisterType" : "Hytera RRS", "SourceID" : 2060000 }

{ "Event" : "De-Registration", "RegisterType" : "Hytera RRS", "SourceID" : 2040000 }

{ "Event" : "Registration", "RegisterType" : "Motorola ARS", "SourceID" : 2060000 }

{ "Event" : "De-Registration", "RegisterType" : "Motorola ARS", "SourceID" : 2040000 }

{ "Event" : "Presence", "SourceID" : 2060000 }

{ "Event" : "Location-Report", "SourceID" : 2040000, "Latitude" : 50.904121, "Longitude" : 5.968765, "Speed" : 0.000000, "Course" : 266.000000, "Altitude" : nan }

</syntaxhighlight>

Master/<Network ID>/Repeater

<syntaxhighlight lang="javascript"> {

  1. "Event" : "Repeater-Data",
  2. "RepeaterID" : 204304,
  3. "Name" : "PD0ZRY",
  4. "Hardware" : "RD625-00000000-000000-U1-0-B",
  5. "Firmware" : "A7.00.09.005",
  6. "TXFrequency" : 433.7000,
  7. "RXFrequency" : 439.7000,
  8. "ColorCode" : 1,
  9. "SlotLink" : 3,
  10. "ExtraData" : ""

}

{

  1. "Event" : "Alarm",
  2. "RepeaterID" : 204304,
  3. "Type" : "Raise",
  4. "Name" : "VSWR Alarm",
  5. "Data" : "N/A"

}

{

  1. "Event" : "Repeater-Data",
  2. "RepeaterID" : 250102,
  3. "Name" : "UB1AAM",
  4. "Hardware" : "MMDVM",
  5. "Firmware" : "20160203",
  6. "TXFrequency" : 437.5500,
  7. "RXFrequency" : 432.5500,
  8. "ColorCode" : 1,
  9. "SlotLink" : 3,
  10. "ExtraData" : "UB1AAM 432550000437550000010159.00000030.000000000St.Petersburg Multi-Mode Repeater www.dstar.su 20160203 MMDVM "

}

</syntaxhighlight>

Master/<Network ID>/System

These are examples of send data <syntaxhighlight lang="javascript"> { "Event" : "External-Event", "Text" : "configuration changed" } </syntaxhighlight>

Master/<Network ID>/Incoming/<Command | Message | Announce>/<Source ID>/<Destination ID>

Syntax of these messages described in example section of this article.

Master/<Network ID>/Outgoing/Message/<Source ID>/<Destination ID>

Message contains text in encoding UTF-16LE.

Master/<Network ID>/Incoming/Report/<Source ID>/<Destination ID>

Message contains binary octet of status value:

  • 8 - Success
  • 64 and greater - some kind of delivery error

Examples

Query presence of terminal

  1. mosquitto_pub -t Master/2501/Outgoing/Command/250999/2503002 -m 'query presence'
  2. # Network ID-| Source ID-| |-Destination ID

Query location of terminal

  1. mosquitto_pub -t Master/2501/Outgoing/Command/250999/2503002 -m 'query location'
  2. # Network ID-| Source ID-| |-Destination ID

Query telemetry of terminal

  1. mosquitto_pub -t Master/2501/Outgoing/Command/250999/2503002 -m 'query telemetry'
  2. # Network ID-| Source ID-| |-Destination ID

Start triggered location service

  1. mosquitto_pub -t Master/2501/Outgoing/Command/250999/2503002 -m 'start location service 0'
  2. # Network ID-| Source ID-| |-Destination ID |- Reporting interval (0 = default)

Stop triggered location service

  1. mosquitto_pub -t Master/2501/Outgoing/Command/250999/2503002 -m 'stop location service'
  2. # Network ID-| Source ID-| |-Destination ID

Send telemetry command

  1. mosquitto_pub -t Master/2501/Outgoing/Command/250999/2503002 -m 'send telemetry command 0 0 0 0 0'
  2. # Network ID-| Source ID-| |-Destination ID |*******|- Command Set:
  3. # 0 = None, 20 = Clear, 21 = Set, 22 = Toggle, 23 = Pulse

Transmit private text message

  1. echo 'Hello!' | iconv -t 'UTF-16LE' | \
  2. mosquitto_pub -t Master/2501/Outgoing/Message/250999/2503002 -s
  3. # Network ID-| Source ID-| |-Destination ID

Transmit announce (group text message)

  1. echo 'Hello!' | iconv -t 'UTF-16LE' | \
  2. mosquitto_pub -t Master/2501/Outgoing/Announce/250999/2503 -s
  3. # Network ID-| Source ID-| |-Group ID

Working with MQTT API from PHP

This example requires [phpMQTT Library]

MessagingService.php

<syntaxhighlight lang="php"> <?php

  1. define("SYSTEM_ENCODING", "UTF-8");
  2. define("BROKER_ADDRESS", "localhost");
  3. define("SERVER_NUMBER", 2501);
  1. define("SENDER_PRIVATE_ID", 250999);
  1. define("MESSAGE_TYPE_PRIVATE", "Message");
  2. define("MESSAGE_TYPE_GROUP", "Announce");
  1. define("LOCAL_DATA_GROUP", 9900);
  1. require_once("phpMQTT.php");
  1. $client = new phpMQTT(BROKER_ADDRESS, 1883, __FILE__);
  2. $client->connect();
  1. function transmitMessage($type, $source, $destination, $text)
  2. {
  3. global $client;
  4. $topic = "Master/" . SERVER_NUMBER . "/Outgoing/" . $type . "/" . $source . "/" . $destination;
  5. $content = iconv(SYSTEM_ENCODING, "UTF-16LE", $text);
  6. $client->publish($topic, $content, 0);
  7. };
  1. function transmitPrivateMessage($destination, $text)
  2. {
  3. transmitMessage(MESSAGE_TYPE_PRIVATE, SENDER_PRIVATE_ID, $destination, $text);
  4. };
  1. function transmitCountryWideMessage($group, $text)
  2. {
  3. transmitMessage(MESSAGE_TYPE_GROUP, SENDER_PRIVATE_ID, $destination, $text);
  4. };
  1. function transmitRepeaterAreaWideMessage($repeater, $text)
  2. {
  3. transmitMessage(MSG_TYPE_GROUP, $repeater, LOCAL_DATA_GROUP, $text);
  4. };


?> </syntaxhighlight>

Example of usage

<syntaxhighlight lang="php"> <?php

  1. require_once("MessagingService.php");
  1. transmitPrivateMessage(2503002, "Hello World!");
  2. transmitCountryWideMessage(2503, "Hello World!");
  3. transmitRepeaterAreaWideMessage(250301, "Hello World!");

?> </syntaxhighlight>

Topics[edit]

Master/<Network ID>/Session[edit]

These are examples of send data <syntaxhighlight lang="javascript"> {

  1. "Event" : "Session-Start",
  2. "LinkName" : "Hytera Multi-Site Connect",
  3. "LinkType" : 1,
  4. "ContextID" : 204204,
  5. "SessionID" : "d8655c54-b0dd-11e5-8f29-52540019894c",
  6. "SessionType" : 17,
  7. "Slot" : 2,
  8. "SourceID" : 2042076,
  9. "DestinationID" : 5057,
  10. "Route" : "None"

}

{

  1. "Event" : "Session-Update",
  2. "LinkName" : "Hytera Multi-Site Connect",
  3. "LinkType" : 1,
  4. "ContextID" : 204204,
  5. "SessionID" : "d8655c54-b0dd-11e5-8f29-52540019894c",
  6. "SessionType" : 9,
  7. "Slot" : 2,
  8. "SourceID" : 2042076,
  9. "DestinationID" : 5057,
  10. "Route" : "A0"

}

{

  1. "Event" : "Signal-Strength",
  2. "SessionID" : "26ddaf9e-b0de-11e5-8f29-52540019894c",
  3. "Strength" : -83.00

}

{

  1. "Event" : "Session-Stop",
  2. "LinkName" : "Hytera Multi-Site Connect",
  3. "LinkType" : 1,
  4. "ContextID" : 204101,
  5. "SessionID" : "26ddaf9e-b0de-11e5-8f29-52540019894c",
  6. "SessionType" : 9,
  7. "Slot" : 1,
  8. "SourceID" : 2042036,
  9. "DestinationID" : 5059,
  10. "State" : 2,
  11. "DataCount" : 4

}

{

  1. "Event" : "Loss-Rate",
  2. "SessionID" : "26ddaf9e-b0de-11e5-8f29-52540019894c",
  3. "LossCount" : 0,
  4. "TotalCount" : 5

} </syntaxhighlight>

Master/<Network ID>/Service[edit]

These are examples of send data <syntaxhighlight lang="javascript"> { "Event" : "Registration", "RegisterType" : "Hytera RRS", "SourceID" : 2060000 }

{ "Event" : "De-Registration", "RegisterType" : "Hytera RRS", "SourceID" : 2040000 }

{ "Event" : "Registration", "RegisterType" : "Motorola ARS", "SourceID" : 2060000 }

{ "Event" : "De-Registration", "RegisterType" : "Motorola ARS", "SourceID" : 2040000 }

{ "Event" : "Presence", "SourceID" : 2060000 }

{ "Event" : "Location-Report", "SourceID" : 2040000, "Latitude" : 50.904121, "Longitude" : 5.968765, "Speed" : 0.000000, "Course" : 266.000000, "Altitude" : nan }

</syntaxhighlight>

Master/<Network ID>/Repeater[edit]

<syntaxhighlight lang="javascript"> {

  1. "Event" : "Repeater-Data",
  2. "RepeaterID" : 204304,
  3. "Name" : "PD0ZRY",
  4. "Hardware" : "RD625-00000000-000000-U1-0-B",
  5. "Firmware" : "A7.00.09.005",
  6. "TXFrequency" : 433.7000,
  7. "RXFrequency" : 439.7000,
  8. "ColorCode" : 1,
  9. "SlotLink" : 3,
  10. "ExtraData" : ""

}

{

  1. "Event" : "Alarm",
  2. "RepeaterID" : 204304,
  3. "Type" : "Raise",
  4. "Name" : "VSWR Alarm",
  5. "Data" : "N/A"

}

{

  1. "Event" : "Repeater-Data",
  2. "RepeaterID" : 250102,
  3. "Name" : "UB1AAM",
  4. "Hardware" : "MMDVM",
  5. "Firmware" : "20160203",
  6. "TXFrequency" : 437.5500,
  7. "RXFrequency" : 432.5500,
  8. "ColorCode" : 1,
  9. "SlotLink" : 3,
  10. "ExtraData" : "UB1AAM 432550000437550000010159.00000030.000000000St.Petersburg Multi-Mode Repeater www.dstar.su 20160203 MMDVM "

}

</syntaxhighlight>

Master/<Network ID>/System[edit]

These are examples of send data <syntaxhighlight lang="javascript"> { "Event" : "External-Event", "Text" : "configuration changed" } </syntaxhighlight>

Master/<Network ID>/Incoming/<Command | Message | Announce>/<Source ID>/<Destination ID>[edit]

Syntax of these messages described in example section of this article.

Master/<Network ID>/Outgoing/Message/<Source ID>/<Destination ID>[edit]

Message contains text in encoding UTF-16LE.

Master/<Network ID>/Incoming/Report/<Source ID>/<Destination ID>[edit]

Message contains binary octet of status value:

Examples[edit]

Query presence of terminal[edit]

  1. mosquitto_pub -t Master/2501/Outgoing/Command/250999/2503002 -m 'query presence'
  2. # Network ID-| Source ID-| |-Destination ID

Query location of terminal[edit]

  1. mosquitto_pub -t Master/2501/Outgoing/Command/250999/2503002 -m 'query location'
  2. # Network ID-| Source ID-| |-Destination ID

Query telemetry of terminal[edit]

  1. mosquitto_pub -t Master/2501/Outgoing/Command/250999/2503002 -m 'query telemetry'
  2. # Network ID-| Source ID-| |-Destination ID

Start triggered location service[edit]

  1. mosquitto_pub -t Master/2501/Outgoing/Command/250999/2503002 -m 'start location service 0'
  2. # Network ID-| Source ID-| |-Destination ID |- Reporting interval (0 = default)

Stop triggered location service[edit]

  1. mosquitto_pub -t Master/2501/Outgoing/Command/250999/2503002 -m 'stop location service'
  2. # Network ID-| Source ID-| |-Destination ID

Send telemetry command[edit]

  1. mosquitto_pub -t Master/2501/Outgoing/Command/250999/2503002 -m 'send telemetry command 0 0 0 0 0'
  2. # Network ID-| Source ID-| |-Destination ID |*******|- Command Set:
  3. # 0 = None, 20 = Clear, 21 = Set, 22 = Toggle, 23 = Pulse

Transmit private text message[edit]

  1. echo 'Hello!' | iconv -t 'UTF-16LE' | \
  2. mosquitto_pub -t Master/2501/Outgoing/Message/250999/2503002 -s
  3. # Network ID-| Source ID-| |-Destination ID

Transmit announce (group text message)[edit]

  1. echo 'Hello!' | iconv -t 'UTF-16LE' | \
  2. mosquitto_pub -t Master/2501/Outgoing/Announce/250999/2503 -s
  3. # Network ID-| Source ID-| |-Group ID

Working with MQTT API from PHP[edit]

This example requires [phpMQTT Library]

MessagingService.php[edit]

<syntaxhighlight lang="php"> <?php

  1. define("SYSTEM_ENCODING", "UTF-8");
  2. define("BROKER_ADDRESS", "localhost");
  3. define("SERVER_NUMBER", 2501);
  1. define("SENDER_PRIVATE_ID", 250999);
  1. define("MESSAGE_TYPE_PRIVATE", "Message");
  2. define("MESSAGE_TYPE_GROUP", "Announce");
  1. define("LOCAL_DATA_GROUP", 9900);
  1. require_once("phpMQTT.php");
  1. $client = new phpMQTT(BROKER_ADDRESS, 1883, __FILE__);
  2. $client->connect();
  1. function transmitMessage($type, $source, $destination, $text)
  2. {
  3. global $client;
  4. $topic = "Master/" . SERVER_NUMBER . "/Outgoing/" . $type . "/" . $source . "/" . $destination;
  5. $content = iconv(SYSTEM_ENCODING, "UTF-16LE", $text);
  6. $client->publish($topic, $content, 0);
  7. };
  1. function transmitPrivateMessage($destination, $text)
  2. {
  3. transmitMessage(MESSAGE_TYPE_PRIVATE, SENDER_PRIVATE_ID, $destination, $text);
  4. };
  1. function transmitCountryWideMessage($group, $text)
  2. {
  3. transmitMessage(MESSAGE_TYPE_GROUP, SENDER_PRIVATE_ID, $destination, $text);
  4. };
  1. function transmitRepeaterAreaWideMessage($repeater, $text)
  2. {
  3. transmitMessage(MSG_TYPE_GROUP, $repeater, LOCAL_DATA_GROUP, $text);
  4. };


?> </syntaxhighlight>

Example of usage[edit]

<syntaxhighlight lang="php"> <?php

  1. require_once("MessagingService.php");
  1. transmitPrivateMessage(2503002, "Hello World!");
  2. transmitCountryWideMessage(2503, "Hello World!");
  3. transmitRepeaterAreaWideMessage(250301, "Hello World!");

?> </syntaxhighlight>