Device Register

Device register sequence diagram

sequenceDiagram

participant Device
participant CCP
participant IoT as Cloud IoT Service
participant App as Other Apps

Device ->> CCP : Register
alt exist
    CCP -->> Device : Error, Device already registered
else not exist
    CCP ->> +IoT : Create Client
    IoT -->> -CCP : IoT Device Info.
    CCP ->> App : Sync
    CCP -->> Device : Register Info
end

Device register flowchart

graph TB
    S([Start]) --> |Register|B{Check device is exist}
    B --> |not exist|C{Check guid has value}
    B --> |exist|E([Error])

    C --> |no|P{Check product guid has value}
    C --> |yes|D[Assign the guid]
    D --> P

    P --> |no|F[Create IoTHub Device]
    P --> |yes|H{check product is exist}
    H --> |yes|I[Assign the product]
    H --> |no|E

    I --> F
    F --> DB[(Database)]

    DB --> |Sync|G[Backend Other App Systems]
    DB -.-> N[Notify to Admin]
    G --> Success([Success])

Device Register API for device IoT WebAPI.

April 22, 2020