OpenOCD
strutil.c File Reference

String utility functions. More...

Include dependency graph for strutil.c:

Go to the source code of this file.

Functions

JAYLINK_API int jaylink_parse_serial_number (const char *str, uint32_t *serial_number)
 Convert a string representation of a serial number to an integer. More...
 

Detailed Description

String utility functions.

Definition in file strutil.c.

Function Documentation

◆ jaylink_parse_serial_number()

JAYLINK_API int jaylink_parse_serial_number ( const char *  str,
uint32_t *  serial_number 
)

Convert a string representation of a serial number to an integer.

The string representation of the serial number must be in decimal form.

Parameters
[in]strString representation to convert.
[out]serial_numberSerial number on success, and undefined on failure.
Return values
JAYLINK_OKSuccess.
JAYLINK_ERR_ARGInvalid arguments.
JAYLINK_ERRConversion error. Serial number is invalid or string representation contains invalid character(s).
Since
0.1.0

Definition at line 48 of file strutil.c.

References JAYLINK_ERR, JAYLINK_ERR_ARG, and JAYLINK_OK.

Referenced by COMMAND_HANDLER(), and parse_serial_number().