GET Message
Send a simple GET message to the Lightbug device.
Retrieve IDs
This is an example of sending a M35 Device IDs message to the Lightbug device, which will return a variety of IDs including the device ID, IMEI, ICCID.
Code
toit
import lightbug.devices as devices
import lightbug.services as services
import lightbug.messages.messages_gen as messages
main:
resp := ((devices.I2C).comms.send messages.DeviceIDs.get-msg --withLatch=true).get
data := messages.DeviceIDs.from-data resp.data
print "ID: $(data.id)"
print "IMEI: $(data.imei)"
print "ICCID: $(data.iccid)"Output
[jaguar] INFO: program 760df138-6a5a-9df1-a469-b3f97da57a21 started
ID: 10570000
IMEI: 004950000212000
ICCID: 00457300000022210000
[jaguar] INFO: program 760df138-6a5a-9df1-a469-b3f97da57a21 stopped