Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
Iot
提交
80d67e01
I
Iot
项目概览
jobily
/
Iot
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
Iot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
80d67e01
编写于
3月 28, 2022
作者:
L
Laurent Ellerbach
提交者:
GitHub
3月 28, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adjusting to add missing resources (#1838)
上级
55110789
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
25 addition
and
2 deletion
+25
-2
src/Iot.Device.Bindings/Iot.Device.Bindings.csproj
src/Iot.Device.Bindings/Iot.Device.Bindings.csproj
+3
-0
src/devices/BuildHat/Brick.cs
src/devices/BuildHat/Brick.cs
+22
-2
未找到文件。
src/Iot.Device.Bindings/Iot.Device.Bindings.csproj
浏览文件 @
80d67e01
...
...
@@ -42,6 +42,9 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="../devices/CharacterLcd/BigFontMap.txt" />
<EmbeddedResource Include="../devices/BuildHat/data/firmware.bin" />
<EmbeddedResource Include="../devices/BuildHat/data/signature.bin"/>
<EmbeddedResource Include="../devices/BuildHat/data/version" />
</ItemGroup>
<!-- This target will call into each device binding project to get out the source files for the framework we are building
and then it will add the results to the Compile item group. -->
...
...
src/devices/BuildHat/Brick.cs
浏览文件 @
80d67e01
...
...
@@ -10,6 +10,7 @@ using System.Globalization;
using
System.IO
;
using
System.IO.Ports
;
using
System.Linq
;
using
System.Reflection
;
using
System.Text
;
using
System.Threading
;
using
BuildHat.Models
;
...
...
@@ -806,8 +807,27 @@ namespace Iot.Device.BuildHat
prompt
=
PortReadExisting
();
// Load both files
byte
[]
firmware
=
Resource
.
firmware
;
byte
[]
signature
=
Resource
.
signature
;
var
assembly
=
Assembly
.
GetExecutingAssembly
();
string
firmwareName
=
assembly
.
GetManifestResourceNames
().
Single
(
str
=>
str
.
EndsWith
(
"firmware.bin"
));
string
signatureName
=
assembly
.
GetManifestResourceNames
().
Single
(
str
=>
str
.
EndsWith
(
"signature.bin"
));
// Similar to: byte[] firmware = Resource.firmware;
// But need to be more generic because of the way the building dll is built
byte
[]
firmware
;
using
(
Stream
stream
=
assembly
.
GetManifestResourceStream
(
firmwareName
)!)
{
firmware
=
new
byte
[
stream
.
Length
];
stream
.
Read
(
firmware
,
0
,
firmware
.
Length
);
}
// Similar to: byte[] signature = Resource.signature;
// But need to be more generic because of the way the building dll is built
byte
[]
signature
;
using
(
Stream
stream
=
assembly
.
GetManifestResourceStream
(
signatureName
)!)
{
signature
=
new
byte
[
stream
.
Length
];
stream
.
Read
(
signature
,
0
,
signature
.
Length
);
}
// Step 1: clear and get the prompt
PortWrite
(
"clear\r"
);
prompt
=
PortReadLine
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录