Raspberry pi serial number compare uint_32t

-1

I have a small C code which is capturing the serial number of the raspi through mailbox :

int fd = open("/dev/vcio", 0);
if (fd == -1)
{
    perror("open /dev/vcio");
    exit(EXIT_FAILURE);
}

uint32_t property[32] =
{
    0x00000000,
    0x00000000,
    0x00010004,
    0x00000010,
    0x00000000,
    0x00000000,
    0x00000000,
    0x00000000,
    0x00000000,
    0x00000000
};

property[0] = 10 * sizeof(property[0]);

if (ioctl(fd, _IOWR(100, 0, char *), property) == -1)
{
    perror("ioctl");
    exit(EXIT_FAILURE);
}

close(fd);

uint32_t serial = property[5];

printf("serial: %016"PRIx32"\n", serial);

it printing :

serial: 00000000396610ff

I am lack off C knowledge to this point ? I want to compare this 00000000396610ff number with the captured serial ?

how can I do that ?

thanks in advance

PS: Will be compile in gcc

c
raspberry-pi
asked on Stack Overflow Dec 13, 2018 by 2adnielsenx xx • edited Dec 13, 2018 by Matthieu Brucher

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0