# Update Sequence

The DFU client scans for a device advertising the configured service ID (normally the DFU service ID). When the device is found, the DFU client connects to the device and reads its characteristics (Device ID, Versions, Build ID). The client must only accept FOTA images with matching Device IDs, unless the Device ID characteristic is all 0s, which means the device is compatible with all FOTA images.

If the Build ID of the application sub-image differs from the Build ID characteristic, the client needs to download the FOTA stack sub-image first. After this downloads successfully, the client needs to disconnect from the device, which restarts the device with the new FOTA stack. Now the client needs to reconnect to the same device.

If the Build ID of the application sub-image matches the Build ID characteristic, the client needs to download the Application sub-image. After successfully downloading, the client needs to disconnect from the device, which restarts the device with the new user application.