Hi Ayoob,

We will go through the provided screens and come up with a UXD as soon as
possible. Will contact you for any clarifications.

On Tue, Jun 6, 2017 at 10:52 AM, Chathura Ekanayake <chath...@wso2.com>
wrote:

>
>
> On Mon, Jun 5, 2017 at 4:35 PM, Ayyoob Hamza <ayy...@wso2.com> wrote:
>
>>
>>>>
>>>> *How to register a device type?*
>>>> 1) Create A Device Type:
>>>>
>>>> curl -X POST http://localhost:8280/api/devi
>>>> ce-mgt/v1.0/admin/device-types -H 'authorization: Bearer
>>>> 77d11b5e-2363-3c99-afb3-c0381600b977' -H 'content-type:
>>>> application/json' -d '{"name": "firealarm","deviceTypeMetaDefinition":
>>>> {"properties": ["buildingId", "floorId"],"features": [{"code":
>>>> "bulb","name": "control bulb","description": "on the bulb"},{"code":
>>>> "ring","name": "ring","description": "this can be used test"}],"claimable":
>>>> true,"pushNotificationConfig": {"type": "MQTT","scheduled":
>>>> false},"policyMonitoringEnabled": false,"description": "this is a new
>>>> remote control firealarm", "initialOperationConfig": {"operations":
>>>> ["bulb"]}}}'
>>>>
>>>> 2) Create Event Definition
>>>>
>>>> curl -X POST http://localhost:8280/api/device-mgt/v1.0/events/firealarm
>>>> -H 'authorization: Bearer 77d11b5e-2363-3c99-afb3-c0381600b977' -H
>>>> 'content-type: application/json' -d '{"eventAttributes": {"attributes":
>>>> [{"name": "temperature","type": "DOUBLE"},{"name": "status","type":
>>>> "STRING"},{"name": "humidity","type": "FLOAT"}]},"transport": "MQTT"}'
>>>>
>>>
>>> As events published by a device type is a configuration of the device
>>> type itself, can we add this to the create device type method, instead of
>>> having a separate method for creating event definitions.
>>>
>>>
>> I had the same doubt while implementing this but had to do this because
>> of two reasons
>>
>> 1) Above event defintiion api call creates a stream, event sink, event
>> purge and a websocket publisher. Since this is part of analytics flow had
>> to separate the api call.
>>
>> 2) we don't maintain the stream definition as part of device type
>> definition in the device management layer(AFAIK, upto now we didnt had a
>> requirement todo so, earlier we tried todo this as part of sensor
>> management but event defniniton might not depend only on sensor
>> definition). In addition, I seperated the api calls to avoid transaction
>> failures, since these are two separate systems
>>
>
> IMO both above are implementation details. It is better if an external
> user who is creating a device type doesn't need to worry about it. In the
> current API call user can provide properties and operations of a device
> type. If the user can provide data that will be published by the device
> type as well in the same config, I think it will make it more complete.
>
>
>>
>>
>>>
>>>> *How to enroll a device *
>>>>
>>>> curl -k -X POST https://localhost:8243/api/dev
>>>> ice-mgt/v1.0/device/agent/enroll -H 'accept: application/json' -H
>>>> 'authorization: Bearer 34670364-56c8-3f25-ac04-5c01af28c6d1' -H
>>>> 'content-type: application/json' -d '{ "name": "myhomealarmx1", "type":
>>>> "firealarm", "description": "this alarm is placed in my house",
>>>> "deviceIdentifier": "123422", "enrolmentInfo": {"ownership": "BYOD",
>>>> "status": "ACTIVE", "owner": "admin"} ,"properties": [{"name":
>>>> "buildingId","value": "wso2"}, {"name": "floorId","value": "2"}]}'
>>>>
>>>
>>> Does this return a token, which can be used by the device for subsequent
>>> interactions with the server? (i.e. device owner can embed such token in
>>> the device)
>>>
>> Is'nt it enrollment of a device and token generation are two different
>> task ?. This is why in Device Type View UI I have listed the command to
>> generate token.
>>
>
> In that case, we have to provide an API to get a token by providing the
> device identifier and the device identifier has to be returned from the
> above call.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "WSO2 IoT Team Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to iot-group+unsubscr...@wso2.com.
> For more options, visit https://groups.google.com/a/wso2.com/d/optout.
>



-- 
*Thanks and Best Regards,*
Imesh Ashandimal Chandrasiri
*Software Engineer*
WSO2, Inc.
lean . enterprise . middleware
*E:* ime...@wso2.com | *P:* 0716519187


Disclaimer: This communication may contain privileged or other confidential
information and is intended exclusively for the addressee/s. If you are not
the intended recipient/s, or believe that you may have received this
communication in error, please reply to the sender indicating that fact and
delete the copy you received and in addition, you should not print, copy,
retransmit, disseminate, or otherwise use the information contained in this
communication. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for any
errors or omissions.
_______________________________________________
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to