libjaylink  0.3.1
Library to access J-Link devices
Functions
strutil.c File Reference

String utility functions. More...

#include <stdlib.h>
#include <stdint.h>
#include <errno.h>
#include "libjaylink.h"

Functions

int jaylink_parse_serial_number (const char *str, uint32_t *serial_number)
 Convert a string representation of a serial number to an integer. More...
 
const char * jaylink_hardware_type_string (enum jaylink_hardware_type type)
 Get the string representation of a hardware type. More...
 
const char * jaylink_target_interface_string (enum jaylink_target_interface iface)
 Get the string representation of a target interface. More...
 

Detailed Description

String utility functions.

Function Documentation

const char* jaylink_hardware_type_string ( enum jaylink_hardware_type  type)

Get the string representation of a hardware type.

Parameters
[in]typeHardware type.
Returns
The string representation of the given hardware type, or NULL for an unknown type.
Since
0.3.0
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
const char* jaylink_target_interface_string ( enum jaylink_target_interface  iface)

Get the string representation of a target interface.

Parameters
[in]ifaceTarget interface.
Returns
The string representation of the given target interface, or NULL for an unknown interface.
Since
0.3.0