int eth32_get_serialnum_string(eth32 handle, char *serial, int bufsize);
This function retrieves the serial number of the ETH32 device in string format as it is printed on the device. To retrieve the components of the serial number in numeric format, see the eth32_get_serialnum function.
handle - The value returned by the eth32_open function.
serial - Pointer to a string buffer that will be receive the serial number string. The function will add a null termination byte to the end of the string.
bufsize - Specifies how long, in bytes, the buffer pointed to by the serial parameter is. If the function determines the buffer length is not long enough to hold the serial number, it does not write anything in to the buffer and returns an error (ETH_INVALID_OTHER).
This function returns zero on success and a negative error code on failure. Please see the Error Codes section for possible error codes.
The serial number is made up of several components and arranged as follows:
(productid)-(batch)(unit)
where:
productid is a number identifying the product type/model. This number is returned by the eth32_get_product_id function.
batch is the batch number formatted as two letters. 1 becomes AA, 2 becomes AB, etc.
unit is the unit number, zero padded to 3 digits if necessary.
eth32 handle; int result; char serial[50]; // .... Your code that establishes a connection here // Retrieve the serial number result=eth32_get_serialnum_string(handle, serial, sizeof(serial)); if(result) { // Handle error } printf("The device's serial number is %s\n", serial);