LEGO Mindstorms EV3


Device Setup

The supported device types are stored in an internal "TypeData" table with a couple of fixed types (Error, Open, UnKnown) and the rest loaded from the "typedata" text file located in the "sys/settings" folder.

When a device is attached or removed on a port the DCM driver Device Detection Manager Driver will change the ANALOG struct (polled by the VM requesting device list) and this way get the knowledge to this Input Library.
This change starts a search in the "TypeData" table if the port connection type has changed. If the device connection type is a "DUMB" (new sensor) the search is done among entries that have an "IdValue" - if match with the device IdValue is found - index to the "TypeData" table is saved as device "TypeIndex".

Independent of the connection type a search is started among all entries and if a match with the device type is found this index to "TypeData" table is saved as device "TypeIndex" (if connection type is "DUMB" - the new index will override the previous index).

An equal search is done when the VM reads a device value with a different type than the detected one.

If the VM reads a device with a different type than the detected one - the device "TypeIndex" will be changed accordingly.


LEGO® Robotics Firmware Documentation
Confidential Information © 2013 The LEGO Group