thermferm/devices.c

changeset 570
1e0192b295b9
parent 553
4091d4fe217f
child 573
479878d528f2
equal deleted inserted replaced
569:9c69d43bfb06 570:1e0192b295b9
1 /***************************************************************************** 1 /*****************************************************************************
2 * Copyright (C) 2014..2018 2 * Copyright (C) 2014..2019
3 * 3 *
4 * Michiel Broek <mbroek at mbse dot eu> 4 * Michiel Broek <mbroek at mbse dot eu>
5 * 5 *
6 * This file is part of the mbsePi-apps 6 * This file is part of the mbsePi-apps
7 * 7 *
479 if (strcmp(buf, (char *)"3a") == 0) 479 if (strcmp(buf, (char *)"3a") == 0)
480 subdevices = 2; 480 subdevices = 2;
481 for (i = 0; i < subdevices; i++) { 481 for (i = 0; i < subdevices; i++) {
482 ndev = (devices_list *)malloc(sizeof(devices_list)); 482 ndev = (devices_list *)malloc(sizeof(devices_list));
483 ndev->next = NULL; 483 ndev->next = NULL;
484 ndev->version = 1;
485 ndev->uuid = malloc(37); 484 ndev->uuid = malloc(37);
486 uuid_generate(uu); 485 uuid_generate(uu);
487 uuid_unparse(uu, ndev->uuid); 486 uuid_unparse(uu, ndev->uuid);
488 ndev->type = DEVTYPE_W1; 487 ndev->type = DEVTYPE_W1;
489 ndev->direction = DEVDIR_UNDEF; 488 ndev->direction = DEVDIR_UNDEF;
640 */ 639 */
641 subdevices = 9; 640 subdevices = 9;
642 for (i = found; i < subdevices; i++) { 641 for (i = found; i < subdevices; i++) {
643 ndev = (devices_list *)malloc(sizeof(devices_list)); 642 ndev = (devices_list *)malloc(sizeof(devices_list));
644 ndev->next = NULL; 643 ndev->next = NULL;
645 ndev->version = 1;
646 ndev->uuid = malloc(37); 644 ndev->uuid = malloc(37);
647 uuid_generate(uu); 645 uuid_generate(uu);
648 uuid_unparse(uu, ndev->uuid); 646 uuid_unparse(uu, ndev->uuid);
649 ndev->type = DEVTYPE_SIM; 647 ndev->type = DEVTYPE_SIM;
650 ndev->value = ndev->offset = 0; 648 ndev->value = ndev->offset = 0;

mercurial