JSON Output
When calling a native command function to run a command, a JSON string is replied as a result. JSON output has the following fields:
command_code
Each SDK function has its own command_code
. The table below displays the corresponding command_code
value for each command.
Command | command_code (Integer) |
---|---|
getTagMessage | 1 |
start | 2 |
stop | 3 |
setDynamicBuffers | 4 |
clearDynamicBuffers | 5 |
success
true
if run the function successfully. Otherwise, it is false
and there will be values for error_code
and error_desc
.
tag_message
The tag_message
is a snapshot of the tag's data at the time of scanning. The output for tag_message
is fully processed and has the following structure:
Key | Description |
---|---|
tag_id | An ID that uniquely identifies each tag. |
started | true if the state of the smart package is started and recording. For more information about tag states, see Tag States and Tag Lifecycle. |
package_id | Package ID. |
patient_id | Patient ID. |
custom_data_1 | Custom Data 1. |
scan_time | Unix UTC timestamp for when the package was scanned. |
clock_coefficient_correction | true if the clock coefficient correction is enabled. See Tag Timekeeping System - Accuracy for more information. |
event_count | Dose event count. |
tag_events | Dose event list. See tag_events below. |
versioning | Tag's versioning. See versioning below. |
tag_events
The tag_events
is an array of the dose records stored on the tag. The output for tag_events
is fully processed and has the following structure:
Key | Description |
---|---|
type | Dose type: an integer that indicates which cavity in the blister pack the dose was taken from. Only applies to Med-ic packages. See Med-ic Dose Types for more information. |
timesetamp | Unix UTC timestamp for each dose detected. See Tag Timekeeping System for more information. |
versioning
The versioning
contains the tag's model, firmware version, and hardware version. The output for versioning
is fully processed and has the following structure:
Key | Description |
---|---|
model | Tag model: "Med-ic" , "eCap Argus-Loc" or "eCap Screw-Loc" . |
firmware_version | Firmware version. |
hardware_version | Hardware version. |
error_code
The error_code
indicates the error that occurred when the function was run.
error_code | Descriptions |
---|---|
4000 | Unknown error. |
4001 | NFC Reader is unavailable. |
4002 | NFC Reader error. |
4003 | NFC Reader session timeout. |
4004 | Invalid Tag ID. |
4005 | Invalid command. |
4006 | Tag state invalid for command. |
4007 | Invalid command input. |
4008 | Command authentication failed. |
4009 | Command not authorized. |
4010 | Tag not found. |
4011 | Tag Mismatch (by Tag ID). |
4012 | Max try error. |
4013 | Command is not supported. |
4014 | System command error. |
4015 | Failed to connect the tag. |
4016 | Failed to send the command. |
4017 | Command response exception. |
4018 | Manifest malformed exception. |
4019 | Tag is not supported. |
4020 | Tag malformed exception. |
error_desc
Human-readable error description based on the error_code
.
Example A:
NFC Reader session timeout
Output:
{
"command_code" : 1,
"success" : false,
"error_code":4003,
"error_desc":"NFC Reader session timeout."
}