Add a text to the log file of this activity
Text to log.
Optional
alert: booleanTrue to mark this activity as failed, triggering an email alert to subscribers. False by default
Decode a base64 string to an integer number
The base64 encoded string
Optional
offset: numberNumber of bytes to skip before starting to read. Defaults to 0.
Optional
maxByteLength: numberNumber of bytes to read. Must satisfy 0 < byteLength <= 6. Defaults to 6.
A big endian signed integer
Decode a base64 string to a UTF-8 string
The base64 encoded string
A UTF-8 string
use stringToUint8Array and uint8ArrayToString instead
Decode a a base64 string to a Uint8Array
The base64 encoded string
Uint8Array
use stringToUint8Array instead
Decode the first CBOR item in the input into a JavaScript object
The input
Optional
encoding: stringThe decoded javascript object
Encode one or more JavaScript objects into a buffer containing the CBOR bytes
Rest
...objs: any[]any[]
Uint8Array
Close an issue on the system
hashId of the issue to close
Optional
comment: stringoptional comment to add to the issue
Decrypt data
information about the data to decrypt and the encryption cipher
decrypted data
Drop a command from the list of scheduled commands
HashId of the command.
Optional
removeFromScheduledCommands: booleanIf true, the command will not appear in args.scheduledCommands anymore when the device type event handler is called in the future. True by default
Optional
markAsDeleted: booleanIf true, the deletedAt property of the command will be set to the current timestamp. False by default.
Optional
reasonForMarkAsDeleted: stringEncrypt data
information about the data to encrypt and the encryption cipher
object with the encrypted payload, IV and authtag
Inform the system when the next report is expected. The expected report
counter is increased by one. It also creates an obligation for the event
handler to call exec.increaseReportingCounter
before before
. If
increaseReportingCounter is not called in time, the missed report counter
will be increased by one. If too many reports have been missed
consecutively, an issue will be created.
if null is provided, the existing obligation will be cleared (but the expected report counter will not be altered)
Get the form fields of a location or port
type of object to get the fields from
hashId of the object to get the fields from
Get a file by its hashId
HashId of the file
A (Node) buffer containing the contents of the file
Inform the system that the device has obligated its duty to report in as
specified earlier in exec.expectNextReportBefore. Call this function before
informing the system of the next obligation through
exec.expectNextReportBefore
. This function increases the received report
counter by 1 and resets the missed report counter to 0. Note that if this
function is called multiple times for the same asOf
, the system will show
that the device has been reporting too often.
Optional
asOf: DateThe timestamp at which the measurement cycle has been fulfilled, usually the current moment. If left out, the current moment is used.
Encode an integer number into a base64 string
The big endian signed integer
Optional
maxByteLength: numberNumber of bytes to write. Must satisfy 0 < byteLength <= 6. Defaults to 6.
A base64 encoded value
Inform the system that a command has been sent to the device. Will be used to block deletion of a(n overdue) command by a user. Users will never be notified at the startAt of a command if it is not marked as sent.
HashId of the command.
Open an issue on the system
Parse a payload into a condition report
information about the report type and the payload
Schedule a new command for this device
information about the new command
Perform an HTTP request
information about the HTTP request
Update the form fields of the device, its linked location or port
data to store
Optional
object: DeviceFieldsObjectwhere to store it (device by default)
Optional
logInAuditLog: booleanif true, the changes will be logged in the audit log
Encode a UTF-8 string into a base64 string
A UTF-8 string
The base64 encoded value
use stringToUint8Array and uint8ArrayToString instead
Convert a string to a Uint8Array
string to convert
encoding of the input string
Uint8Array
Encode a Uint8Array into a base64 string
Uint8Array
A base64 encoded value
use uint8ArrayToString instead
Convert a Uint8Array to a string
uint8Array to convert
encoding of the output string
string
Commands this handler can execute