NSUKit
1.4.0
板卡级统一交互接口
载入中...
搜索中...
未找到
firmware_update.cpp
浏览该文件的文档.
1
2
// Copyright (c) 2024. Naishu
3
// NSUKit is licensed under Mulan PSL v2.
4
// You can use this software according to the terms and conditions of the Mulan PSL v2.
5
// You may obtain a copy of Mulan PSL v2 at:
6
// http://license.coscl.org.cn/MulanPSL2
7
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
8
// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
9
// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
10
// See the Mulan PSL v2 for more details.
12
13
//
14
// Created by jilianyi<jilianyi@naishu.tech> on 2024/4/12.
15
//
16
17
#include <iostream>
18
#include "
NSUKit.h
"
19
20
int
main
(
int
argc,
char
*argv[]) {
21
nsukit::NSUSoc<nsukit::TCPCmdUItf, nsukit::PCIECmdUItf, nsukit::PCIEStreamUItf>
kit{};
22
23
if
(argc != 3) {
24
std::cout <<
"不受支持的传参方法"
<< std::endl;
25
return
1;
26
}
27
nsuInitParam_t
param;
28
29
param.
cmd_ip
= argv[1];
30
param.
cmd_board
= 0;
31
param.
stream_board
= 0;
32
auto
res = kit.link_cmd(¶m);
33
if
(res !=
nsukitStatus_t::NSUKIT_STATUS_SUCCESS
) {
34
std::cout <<
"建立连接:"
<<
nsukit::status2_string
(res) << std::endl;
35
}
36
37
res |= kit.set_param(
"固件路径"
, argv[2]);
38
if
(res !=
nsukitStatus_t::NSUKIT_STATUS_SUCCESS
) {
39
std::cout <<
"设置参数:"
<<
nsukit::status2_string
(res) << std::endl;
40
}
41
42
res |= kit.execute(
"固件更新"
);
43
if
(res !=
nsukitStatus_t::NSUKIT_STATUS_SUCCESS
) {
44
std::cout <<
"执行固件更新:"
<<
nsukit::status2_string
(res) << std::endl;
45
}
46
47
std::cout <<
"固件更新结果:"
<< kit.get_param<uint32_t>(
"固件更新结果"
) << std::endl;
48
49
return
0;
50
}
NSUKit.h
nsukit::NSUSoc
Definition:
NSUKit.h:31
main
int main()
Definition:
link_only_eth.cpp:19
nsukit::status2_string
std::string NSU_DLLEXPORT status2_string(nsukitStatus_t status)
Definition:
config.cpp:15
nsuInitParam_t
Definition:
type.h:155
nsuTCPParam_t::cmd_ip
std::string cmd_ip
Definition:
type.h:98
nsuXDMAParam_t::cmd_board
nsuBoardNum_t cmd_board
Definition:
type.h:115
nsuXDMAParam_t::stream_board
nsuBoardNum_t stream_board
Definition:
type.h:121
nsukitStatus_t::NSUKIT_STATUS_SUCCESS
@ NSUKIT_STATUS_SUCCESS
examples
firmware_update.cpp
制作者
1.9.6