Arrow / Mbed OS DAPLink Reset
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers dap_strings.h Source File

dap_strings.h

Go to the documentation of this file.
00001 /**
00002  * @file    dap_strings.h
00003  *
00004  * DAPLink Interface Firmware
00005  * Copyright (c) 2019, ARM Limited, All Rights Reserved
00006  * SPDX-License-Identifier: Apache-2.0
00007  *
00008  * Licensed under the Apache License, Version 2.0 (the "License"); you may
00009  * not use this file except in compliance with the License.
00010  * You may obtain a copy of the License at
00011  *
00012  * http://www.apache.org/licenses/LICENSE-2.0
00013  *
00014  * Unless required by applicable law or agreed to in writing, software
00015  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00016  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00017  * See the License for the specific language governing permissions and
00018  * limitations under the License.
00019  */
00020 
00021 #include "cmsis_compiler.h"
00022 #include "info.h"
00023 
00024 /** Get Vendor ID string.
00025 \param str Pointer to buffer to store the string.
00026 \return String length.
00027 */
00028 __STATIC_INLINE uint8_t DAP_GetVendorString (char *str) {
00029   (void)str;
00030   return (0U);
00031 }
00032 
00033 /** Get Product ID string.
00034 \param str Pointer to buffer to store the string.
00035 \return String length.
00036 */
00037 __STATIC_INLINE uint8_t DAP_GetProductString (char *str) {
00038   (void)str;
00039   return (0U);
00040 }
00041 
00042 /** Get Serial Number string.
00043 \param str Pointer to buffer to store the string.
00044 \return String length.
00045 */
00046 __STATIC_INLINE uint8_t DAP_GetSerNumString (char *str) {
00047     const char * data = info_get_unique_id();
00048     uint8_t length = (uint8_t)strlen(data) + 1;
00049     memcpy(str, data, length);
00050     return length;
00051 }
00052 
00053 /** Get firmware version string.
00054 \param str Pointer to buffer to store the string.
00055 \return String length.
00056 */
00057 __STATIC_INLINE uint8_t DAP_GetFirmwareVersionString (char *str) {
00058     const char * data = info_get_version();
00059     uint8_t length = (uint8_t)strlen(data) + 1;
00060     memcpy(str, data, length);
00061     return length;
00062 }