When user plugs device to USB (Bluetooth is similar).
- User plugs Windows Mobile device into USB. Hub realizes this and notifies system.
- Hotplug loads kernel drivers (cdc_ether.ko, ...). Network interface is created and HAL is notified about this.
- HAL executes configuration scripts for that device, which mostly launch DHCP client daemon which obtains IP address from the device.
- The device opens TCP connection to the host on TCP port 990 and scenario continues in odccm and vdccm daemons.
Some handshake steps have to be performed before a stable initial connection between the device and the host is established. This handshake is fully implemented in odccm and vdccm.
- The device connects to the host on TCP port 990.
- After esteblishing this TCP connection, the device sends four bytes {0x00, 0x00, 0x00, 0x00} via that connection to the host.
- The host has to respond with four bytes also {0x03, 0x00, 0x00, 0x00}.
- The device answers that response by again sending four bytes {0x04, 0x00, 0x00, 0x00} to the host.
The host must not send a response to that answer. Instead, the device transmits the DeviceInfoPackage to the host.
- The connection is established.
To keep the connection up, the host has to send ping packages consisting of {0x01, 0x00, 0x00, 0x00} to the device periodically (ActiveSync does this every 40th second).
- The device responds to a ping by sending the four bytes {0x02, 0x00, 0x00, 0x00}.
