+
+ END OBJ(i2c, INFO_PLATFORM)
+ char buf1[64], buf2[64];
+ int n;
+
+ if (!arg) {
+ ERR("platform needs arguments");
+ obj->type = OBJ_text;
+ return NULL;
+ }
+
+ if (sscanf(arg, "%63s %63s %d", buf1, buf2, &n) != 3) {
+ /* if scanf couldn't read three values, read type and num and use default device */
+ sscanf(arg, "%63s %d", buf2, &n);
+ obj->data.platform.fd =
+ open_platform_sensor(0, buf2, n, &obj->data.platform.arg, obj->data.platform.devtype);
+ strncpy(obj->data.platform.type, buf2, 63);
+ } else {
+ obj->data.platform.fd =
+ open_platform_sensor(buf1, buf2, n, &obj->data.platform.arg, obj->data.platform.devtype);
+ strncpy(obj->data.platform.type, buf2, 63);
+ }