Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
haoJin750TFT
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
时昊
haoJin750TFT
Commits
c45f0b9f
Commit
c45f0b9f
authored
Sep 11, 2024
by
张金硕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:新增蓝牙名和电话本总数的字库接口
parent
64e3e0bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
BlueTooth.c
Firmware/Source/Application/BlueTooth.c
+39
-0
BlueTooth.h
Firmware/Source/Application/BlueTooth.h
+2
-0
No files found.
Firmware/Source/Application/BlueTooth.c
View file @
c45f0b9f
...
...
@@ -7,6 +7,7 @@ uint8_t GetBlueToothVaild = 0;
uint8_t
GetPhoneBookVaild
=
0
;
uint8_t
TextInit
=
0
;
uint8_t
SetUUIDTimes
=
0
;
uint16_t
LastPhoneBookTotalCount
=
0
;
_PICID_Struct
PicObj
;
_QRCODE_RECT
QRCode_Rect
;
const
uint8_t
HJBlueToothName
[
9
]
=
{
"HJ750"
};
...
...
@@ -131,6 +132,9 @@ uint8_t PhoneNumber[40];
uint8_t
LastPhoneNumber
[
20
];
uint8_t
LastBlueToothPhoneName
[
100
];
uint8_t
CurBlueToothPhoneName
[
100
];
uint8_t
BlueToothName
[
40
];
uint8_t
LastBlueToothName
[
20
];
uint8_t
PhoneNumberTotal
[
20
];
void
TextService
(
void
)
{
...
...
@@ -141,6 +145,9 @@ void TextService(void)
memset
(
LastPhoneNumber
,
0
,
sizeof
(
LastPhoneNumber
));
memset
(
LastBlueToothPhoneName
,
0
,
sizeof
(
LastBlueToothPhoneName
));
memset
(
CurBlueToothPhoneName
,
0
,
sizeof
(
CurBlueToothPhoneName
));
memset
(
BlueToothName
,
0
,
sizeof
(
BlueToothName
));
memset
(
LastBlueToothName
,
0
,
sizeof
(
LastBlueToothName
));
memset
(
PhoneNumberTotal
,
0
,
sizeof
(
PhoneNumberTotal
));
}
if
(
BlueToothPhoneData
.
BlueToothSignalSate
==
BlueTooth_Connection
)
{
...
...
@@ -167,5 +174,37 @@ void TextService(void)
}
}
}
if
(
Menu_Get_Current_Cursor_Information
()
==
MENU_ITEM_BLUETOOTH_CONNECT
)
{
if
(
memcmp
(
LastBlueToothName
,
BlueToothPhoneData
.
BlueToothName
,
sizeof
(
LastBlueToothName
))
!=
0
)
{
for
(
uint8_t
i
=
0
;
i
<
sizeof
(
BlueToothPhoneData
.
BlueToothName
);
i
++
)
{
BlueToothName
[
i
*
2
]
=
BlueToothPhoneData
.
BlueToothName
[
i
];
BlueToothName
[(
i
*
2
)
+
1
]
=
0X00
;
}
memcpy
(
LastBlueToothName
,
BlueToothPhoneData
.
BlueToothName
,
sizeof
(
LastBlueToothName
));
TextPara
[
TEXT_NUM_BLUETOOTH_NAME
].
Vaild
=
0X01
;
}
}
if
(
LastPhoneBookTotalCount
!=
BlueToothPhoneData
.
PhoneBookTotalCount
)
{
uint8_t
TempNumberCnts
=
0
;
if
(
BlueToothPhoneData
.
PhoneBookTotalCount
>
100
)
{
PhoneNumberTotal
[
TempNumberCnts
++
]
=
(
BlueToothPhoneData
.
PhoneBookTotalCount
/
100
)
+
0x30
;
PhoneNumberTotal
[
TempNumberCnts
++
]
=
0x00
;
}
if
(
BlueToothPhoneData
.
PhoneBookTotalCount
>
10
)
{
PhoneNumberTotal
[
TempNumberCnts
++
]
=
(
BlueToothPhoneData
.
PhoneBookTotalCount
/
10
%
10
)
+
0x30
;
PhoneNumberTotal
[
TempNumberCnts
++
]
=
0x00
;
}
PhoneNumberTotal
[
TempNumberCnts
++
]
=
(
BlueToothPhoneData
.
PhoneBookTotalCount
%
100
%
10
)
+
0x30
;
PhoneNumberTotal
[
TempNumberCnts
++
]
=
0x00
;
TextPara
[
TEXT_NUM_PHONE_NUMBER_TOTAL
].
Vaild
=
0x01
;
LastPhoneBookTotalCount
=
BlueToothPhoneData
.
PhoneBookTotalCount
;
}
}
Firmware/Source/Application/BlueTooth.h
View file @
c45f0b9f
...
...
@@ -39,6 +39,8 @@ extern _PICID_Struct PicObj;
extern
_QRCODE_RECT
QRCode_Rect
;
extern
uint8_t
PhoneNumber
[
40
];
extern
uint8_t
CurBlueToothPhoneName
[
100
];
extern
uint8_t
BlueToothName
[
40
];
extern
uint8_t
PhoneNumberTotal
[
20
];
extern
TEXT_STRUCT
TextPara
[];
#endif
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment