Application Tokens
The AppToken represents the higher-level Application that the Conductor
Device is being integrated into.
Note
In order to receive permission to access a Conductor Device, the
Devices themselfs must be registered to an AppToken that
your ConductorAccount owns.
To create an Application Token for your device, all you have to do is
my_app_token = account.create_app_token("My Cool Application")
Now, that Application Token has been created by your account and can be shared
to a Symphony Link Module or LTE CAT-M1 Module to pass data into the cloud. Additionally,
since the Application Token inherits from the UplinkSubject and
DownlinkSubject, it can handle both Uplink (messages from
Devices), and Downlink (messages to Devices).
When receiving Uplink Messages from an AppToken, you will see
messages from every single device registered to that Application Token. The
quickest way to pull messaages is with the AppToken.get_recent_messages()
method, which receives the last messages within the supplied amount of minutes.
This example will get messages from the last hour
msgs = my_app_token.get_recent_messages(60)
When a DownlinkMessaage is sent to your all of an Application’s
devices, it is refered to as a Multicast Downlink. See Downlink Modes for
more information.
Warning
A Multicast DowlinkMessage cannot be Acknowledgedged through Conductor,
so an additional mechanism must be implemented to confirm whether
a particular device received the message or not.
A Multicast DownlinkMessage can be sent with the AppToken.send_message()
method and can be received by any device in the correct Downlink Modes at the
time of being sent, see Downlink Modes for more
dl_msg = my_app_token.send_message(b'Hello Devices!')
To limit the devices receiving the message, the gateway parameter can be
supplied. This routes the Multicast DownlinkMessage through that
specified Gateway explicitly, and will not be receivable to any other
device on that Application Token, that is not connected through that Gateway
my_gw = account.get_gateway("$101$0-0-0-dbXXXXXXX")
dl_msg = my_app_token.send_message(b'Hello Some Devices!', gateway=my_gw)