/AWS1/CL_IOX=>SENDCONNECTOREVENT()
¶
About SendConnectorEvent¶
Relays third-party device events for a connector such as a new device or a device state change event.
Method Signature¶
IMPORTING¶
Required arguments:¶
iv_connectorid
TYPE /AWS1/IOXCONNECTORID
/AWS1/IOXCONNECTORID
¶
The id of the connector between the third-party cloud provider and IoT managed integrations.
iv_operation
TYPE /AWS1/IOXCONNECTOREVENTOP
/AWS1/IOXCONNECTOREVENTOP
¶
The Open Connectivity Foundation (OCF) operation requested to be performed on the managed thing.
The field op can have a value of "I" or "U". The field "cn" will contain the capability types.
Optional arguments:¶
iv_userid
TYPE /AWS1/IOXTHIRDPARTYUSERID
/AWS1/IOXTHIRDPARTYUSERID
¶
The id of the third-party cloud provider.
iv_operationversion
TYPE /AWS1/IOXCONNECTOREVENTOPVRS
/AWS1/IOXCONNECTOREVENTOPVRS
¶
The Open Connectivity Foundation (OCF) security specification version for the operation being requested on the managed thing. For more information, see OCF Security Specification.
iv_statuscode
TYPE /AWS1/IOXCNCTOREVENTSTATUSCODE
/AWS1/IOXCNCTOREVENTSTATUSCODE
¶
The status code of the Open Connectivity Foundation (OCF) operation being performed on the managed thing.
iv_message
TYPE /AWS1/IOXCONNECTOREVENTMESSAGE
/AWS1/IOXCONNECTOREVENTMESSAGE
¶
The device state change event payload.
This parameter will include the following three fields:
uri
:schema auc://<PARTNER-DEVICE-ID>/ResourcePath
(TheResourcepath
corresponds to an OCF resource.)
op
: For device state changes, this field must populate asn+d
.
cn
: The content depends on the OCF resource referenced inResourcePath
.
iv_devicediscoveryid
TYPE /AWS1/IOXDEVICEDISCOVERYID
/AWS1/IOXDEVICEDISCOVERYID
¶
The id for the device discovery job.
iv_connectordeviceid
TYPE /AWS1/IOXCONNECTORDEVICEID
/AWS1/IOXCONNECTORDEVICEID
¶
The third-party device id as defined by the connector. This device id must not contain personal identifiable information (PII).
This parameter is used for cloud-to-cloud devices only.
iv_traceid
TYPE /AWS1/IOXTRACEID
/AWS1/IOXTRACEID
¶
The trace request identifier used to correlate a command request and response. This is specified by the device owner, but will be generated by IoT managed integrations if not provided by the device owner.
it_devices
TYPE /AWS1/CL_IOXDEVICE=>TT_DEVICES
TT_DEVICES
¶
The list of devices.
io_matterendpoint
TYPE REF TO /AWS1/CL_IOXMATTERENDPOINT
/AWS1/CL_IOXMATTERENDPOINT
¶
The device endpoint.
RETURNING¶
oo_output
TYPE REF TO /aws1/cl_ioxsendcnctoreventrsp
/AWS1/CL_IOXSENDCNCTOREVENTRSP
¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->/aws1/if_iox~sendconnectorevent(
io_matterendpoint = new /aws1/cl_ioxmatterendpoint(
it_clusters = VALUE /aws1/cl_ioxmattercluster=>tt_matterclusters(
(
new /aws1/cl_ioxmattercluster(
io_attributes = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
it_commands = VALUE /aws1/cl_rt_document=>tt_map(
(
VALUE /aws1/cl_rt_document=>ts_document_maprow(
key = |string|
value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
)
)
)
it_events = VALUE /aws1/cl_rt_document=>tt_map(
(
VALUE /aws1/cl_rt_document=>ts_document_maprow(
key = |string|
value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
)
)
)
iv_id = |string|
)
)
)
iv_id = |string|
)
it_devices = VALUE /aws1/cl_ioxdevice=>tt_devices(
(
new /aws1/cl_ioxdevice(
io_capabilityreport = new /aws1/cl_ioxmattercapability00(
it_endpoints = VALUE /aws1/cl_ioxmattercapability01=>tt_mattercapabilityrptendpts(
(
new /aws1/cl_ioxmattercapability01(
it_clientclusters = VALUE /aws1/cl_ioxmattercapability09=>tt_mattercapabilityrptendptc00(
( new /aws1/cl_ioxmattercapability09( |string| ) )
)
it_clusters = VALUE /aws1/cl_ioxmattercapability02=>tt_mattercapabilityrptclusts(
(
new /aws1/cl_ioxmattercapability02(
it_attributes = VALUE /aws1/cl_ioxmattercapability03=>tt_mattercapabilityreportattrs(
(
new /aws1/cl_ioxmattercapability03(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_id = |string|
iv_name = |string|
)
)
)
it_commands = VALUE /aws1/cl_ioxmattercapability04=>tt_mattercapabilityreportcmds(
( new /aws1/cl_ioxmattercapability04( |string| ) )
)
it_events = VALUE /aws1/cl_ioxmattercapability05=>tt_mattercapabilityrptevents(
( new /aws1/cl_ioxmattercapability05( |string| ) )
)
it_generatedcommands = VALUE /aws1/cl_ioxmattercapability06=>tt_mattercapabilityrptgendcmds(
( new /aws1/cl_ioxmattercapability06( |string| ) )
)
iv_fabricindex = 123
iv_featuremap = 123
iv_id = |string|
iv_name = |string|
iv_publicid = |string|
iv_revision = 123
iv_specversion = |string|
)
)
)
it_devicetypes = VALUE /aws1/cl_ioxdevicetypes_w=>tt_devicetypes(
( new /aws1/cl_ioxdevicetypes_w( |string| ) )
)
it_parts = VALUE /aws1/cl_ioxmattercapability07=>tt_mattercapabilityrptendptp00(
( new /aws1/cl_ioxmattercapability07( |string| ) )
)
it_semantictags = VALUE /aws1/cl_ioxmattercapability08=>tt_mattercapabilityrptendpts00(
( new /aws1/cl_ioxmattercapability08( |string| ) )
)
iv_id = |string|
)
)
)
iv_nodeid = |string|
iv_version = |string|
)
io_devicemetadata = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
it_capabilityschemas = VALUE /aws1/cl_ioxcapabilityschitem=>tt_capabilityschemas(
(
new /aws1/cl_ioxcapabilityschitem(
io_schema = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_capabilityid = |string|
iv_extrinsicid = |string|
iv_extrinsicversion = 123
iv_format = |string|
)
)
)
iv_connectordeviceid = |string|
iv_connectordevicename = |string|
)
)
)
iv_connectordeviceid = |string|
iv_connectorid = |string|
iv_devicediscoveryid = |string|
iv_message = |string|
iv_operation = |string|
iv_operationversion = |string|
iv_statuscode = 123
iv_traceid = |string|
iv_userid = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_connectorid = lo_result->get_connectorid( ).
ENDIF.
SendConnectorEvent happy path for device discovery¶
SendConnectorEvent happy path for device discovery
DATA(lo_result) = lo_client->/aws1/if_iox~sendconnectorevent(
it_devices = VALUE /aws1/cl_ioxdevice=>tt_devices(
(
new /aws1/cl_ioxdevice(
io_capabilityreport = new /aws1/cl_ioxmattercapability00(
it_endpoints = VALUE /aws1/cl_ioxmattercapability01=>tt_mattercapabilityrptendpts(
(
new /aws1/cl_ioxmattercapability01(
it_clusters = VALUE /aws1/cl_ioxmattercapability02=>tt_mattercapabilityrptclusts(
(
new /aws1/cl_ioxmattercapability02(
it_attributes = VALUE /aws1/cl_ioxmattercapability03=>tt_mattercapabilityreportattrs(
(
new /aws1/cl_ioxmattercapability03(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |"exampleString"| )
iv_id = |0x0000|
)
)
( new /aws1/cl_ioxmattercapability03( iv_id = |0x0001| ) )
( new /aws1/cl_ioxmattercapability03( iv_id = |0x0002| ) )
)
it_commands = VALUE /aws1/cl_ioxmattercapability04=>tt_mattercapabilityreportcmds(
( new /aws1/cl_ioxmattercapability04( |0x00| ) )
( new /aws1/cl_ioxmattercapability04( |0x01| ) )
)
it_events = VALUE /aws1/cl_ioxmattercapability05=>tt_mattercapabilityrptevents(
)
iv_id = |0x0201|
iv_revision = 1
)
)
)
it_devicetypes = VALUE /aws1/cl_ioxdevicetypes_w=>tt_devicetypes(
( new /aws1/cl_ioxdevicetypes_w( |Refrigerator| ) )
)
iv_id = |EP1|
)
)
)
iv_nodeid = |1|
iv_version = |1.0.0|
)
iv_connectordeviceid = |Mock-Connector-DeviceId-1|
iv_connectordevicename = |Sample-User-device-1|
)
)
)
iv_connectorid = |MockConnectorId|
iv_devicediscoveryid = |358275hbk3qr|
iv_message = |Sample ConnectorEventMessage|
iv_operation = |DEVICE_DISCOVERY|
iv_operationversion = |1.0|
iv_statuscode = 200
iv_userid = |MockThirdPartyUserId|
).
SendConnectorEvent happy path for device command response¶
SendConnectorEvent happy path for device command response
DATA(lo_result) = lo_client->/aws1/if_iox~sendconnectorevent(
io_matterendpoint = new /aws1/cl_ioxmatterendpoint(
it_clusters = VALUE /aws1/cl_ioxmattercluster=>tt_matterclusters(
(
new /aws1/cl_ioxmattercluster(
io_attributes = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"0x0000":[73],"0x15570003":"exampleString"\}| )
it_commands = VALUE /aws1/cl_rt_document=>tt_map(
(
VALUE /aws1/cl_rt_document=>ts_document_maprow(
key = |0x03|
value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{\}| )
)
)
)
iv_id = |0x1003|
)
)
)
iv_id = |1|
)
iv_connectorid = |MockConnectorId|
iv_message = |Sample ConnectorEventMessage|
iv_operation = |DEVICE_COMMAND_RESPONSE|
iv_operationversion = |1.0|
iv_statuscode = 200
iv_traceid = |9b75f3839b6140f=_1|
iv_userid = |MockThirdPartyUserId|
).
SendConnectorEvent happy path for device event¶
SendConnectorEvent happy path for device event
DATA(lo_result) = lo_client->/aws1/if_iox~sendconnectorevent(
io_matterendpoint = new /aws1/cl_ioxmatterendpoint(
it_clusters = VALUE /aws1/cl_ioxmattercluster=>tt_matterclusters(
(
new /aws1/cl_ioxmattercluster(
io_attributes = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"0x0000":73\}| )
iv_id = |0x1003|
)
)
)
iv_id = |1|
)
iv_connectorid = |MockConnectorId|
iv_message = |Sample ConnectorEventMessage|
iv_operation = |DEVICE_EVENT|
iv_operationversion = |1.0|
iv_statuscode = 200
iv_traceid = |TraceId-Sample|
iv_userid = |MockThirdPartyUserId|
).