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
839e58e9
Commit
839e58e9
authored
Aug 21, 2024
by
张金硕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:新增对蓝牙名和电话的数据处理
parent
cb093038
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
0 deletions
+87
-0
BlueTooth.c
Firmware/Source/Application/BlueTooth.c
+65
-0
BlueTooth.h
Firmware/Source/Application/BlueTooth.h
+22
-0
No files found.
Firmware/Source/Application/BlueTooth.c
View file @
839e58e9
...
@@ -5,6 +5,7 @@ uint8_t OTA_Update_Count_Close = 0;
...
@@ -5,6 +5,7 @@ uint8_t OTA_Update_Count_Close = 0;
uint8_t
Update_Graphic_Count
=
0
;
uint8_t
Update_Graphic_Count
=
0
;
uint8_t
GetBlueToothVaild
=
0
;
uint8_t
GetBlueToothVaild
=
0
;
uint8_t
GetPhoneBookVaild
=
0
;
uint8_t
GetPhoneBookVaild
=
0
;
uint8_t
TextInit
=
0
;
_PICID_Struct
PicObj
;
_PICID_Struct
PicObj
;
_QRCODE_RECT
QRCode_Rect
;
_QRCODE_RECT
QRCode_Rect
;
const
uint8_t
HJBlueToothName
[
9
]
=
{
"HJ750"
};
const
uint8_t
HJBlueToothName
[
9
]
=
{
"HJ750"
};
...
@@ -14,6 +15,9 @@ uint8_t UUIDConfigBuf[22] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf
...
@@ -14,6 +15,9 @@ uint8_t UUIDConfigBuf[22] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf
// uint8_t PhoneName[100] = {0};
// uint8_t PhoneName[100] = {0};
// uint8_t BlueConnectStatus;
// uint8_t BlueConnectStatus;
// ee_uint16_t juasfha;
// ee_uint16_t juasfha;
void
TextService
(
void
);
void
BlueToothService
()
void
BlueToothService
()
{
{
if
(
Get_Dis_Bluetooth_Open_Close
()
==
0
)
if
(
Get_Dis_Bluetooth_Open_Close
()
==
0
)
...
@@ -47,6 +51,8 @@ void BlueToothService()
...
@@ -47,6 +51,8 @@ void BlueToothService()
{
{
Menu_Change_Branch_To_Item
(
MENU_BRANCH_ANIMATION
,
MENU_ITEM_MAIN_ITEM
);
Menu_Change_Branch_To_Item
(
MENU_BRANCH_ANIMATION
,
MENU_ITEM_MAIN_ITEM
);
}
}
TextService
();
// SetBlueToothName((uint8_t *)HJBlueToothName, sizeof(HJBlueToothName));
// SetBlueToothName((uint8_t *)HJBlueToothName, sizeof(HJBlueToothName));
// SetUUIDData((char *)UUIDConfigBuf, 22);
// SetUUIDData((char *)UUIDConfigBuf, 22);
...
@@ -71,6 +77,65 @@ void BlueToothService()
...
@@ -71,6 +77,65 @@ void BlueToothService()
// SetScreenType(QRCode_TYPE, QRCode_Rect);
// SetScreenType(QRCode_TYPE, QRCode_Rect);
}
}
TEXT_STRUCT
TextPara
[
TEXT_NUM_TOTAL
]
=
{
{
TEXT_NUM_BLUETOOTH_NAME
,
0x4005
,
0
},
{
TEXT_NUM_BLUETOOTH_PHONENAME
,
0x4007
,
0
},
{
TEXT_NUM_PHONE_NUMBER
,
0x4009
,
0
},
{
TEXT_NUM_PHONE_NUMBER_TOTAL
,
0x4011
,
0
},
{
TEXT_NUM_INFORMATION_MCUVER
,
0x4012
,
0
},
{
TEXT_NUM_INFORMATION_SWVERSION
,
0x4013
,
0
},
{
TEXT_NUM_INFORMATION_HW
,
0x4014
,
0
},
//23F 23E
{
TEXT_NUM_INFORMATION_OS
,
0x4015
,
0
},
{
TEXT_NUM_INFORMATION_HMI
,
0x4016
,
0
},
{
TEXT_NUM_ROAD_NAME
,
0x4022
,
0
},
};
uint8_t
PhoneNumber
[
40
];
uint8_t
LastPhoneNumber
[
20
];
uint8_t
LastBlueToothPhoneName
[
100
];
uint8_t
CurBlueToothPhoneName
[
100
];
void
TextService
(
void
)
{
if
(
TextInit
==
0
)
{
TextInit
=
1
;
memset
(
PhoneNumber
,
0
,
sizeof
(
PhoneNumber
));
memset
(
LastPhoneNumber
,
0
,
sizeof
(
LastPhoneNumber
));
memset
(
LastBlueToothPhoneName
,
0
,
sizeof
(
LastBlueToothPhoneName
));
memset
(
CurBlueToothPhoneName
,
0
,
sizeof
(
CurBlueToothPhoneName
));
}
if
(
BlueToothPhoneData
.
BlueToothSignalSate
==
BlueTooth_Connection
)
{
if
((
BlueToothPhoneData
.
BlueToothPhoneSate
==
Phone_Outgoing
)
||
(
BlueToothPhoneData
.
BlueToothPhoneSate
==
Phone_Incoming
)
||
(
BlueToothPhoneData
.
BlueToothPhoneSate
==
Phone_Talking
))
{
if
((
memcmp
(
LastBlueToothPhoneName
,
BlueToothPhoneData
.
BlueToothPhoneName
,
sizeof
(
LastBlueToothPhoneName
)))
!=
0
)
{
for
(
uint8_t
i
=
0
;
i
<
(
sizeof
(
BlueToothPhoneData
.
BlueToothPhoneName
)
/
2
);
i
++
)
{
CurBlueToothPhoneName
[
i
*
2
]
=
BlueToothPhoneData
.
BlueToothPhoneName
[(
i
*
2
)
+
1
];
CurBlueToothPhoneName
[(
i
*
2
)
+
1
]
=
BlueToothPhoneData
.
BlueToothPhoneName
[
i
*
2
];
}
memcpy
(
LastBlueToothPhoneName
,
BlueToothPhoneData
.
BlueToothPhoneName
,
(
sizeof
(
BlueToothPhoneData
.
BlueToothPhoneName
)
/
sizeof
(
BlueToothPhoneData
.
BlueToothPhoneName
[
0
])));
TextPara
[
TEXT_NUM_BLUETOOTH_PHONENAME
].
Vaild
=
0X01
;
}
if
((
memcmp
(
LastPhoneNumber
,
BlueToothPhoneData
.
PhoneNumber
,
sizeof
(
LastPhoneNumber
)))
!=
0
)
{
for
(
uint8_t
i
=
0
;
i
<
sizeof
(
BlueToothPhoneData
.
PhoneNumber
);
i
++
)
{
PhoneNumber
[
i
*
2
]
=
(
uint8_t
)(
BlueToothPhoneData
.
PhoneNumber
[
i
]);
PhoneNumber
[(
i
*
2
)
+
1
]
=
0X00
;
}
memcpy
(
LastPhoneNumber
,
BlueToothPhoneData
.
PhoneNumber
,
(
sizeof
(
BlueToothPhoneData
.
PhoneNumber
)
/
sizeof
(
BlueToothPhoneData
.
PhoneNumber
[
0
])));
TextPara
[
TEXT_NUM_PHONE_NUMBER
].
Vaild
=
0X01
;
}
}
}
}
void
UpdateGraphics
(
void
)
void
UpdateGraphics
(
void
)
{
{
PicObj
.
qr_logo_id
=
0
;
PicObj
.
qr_logo_id
=
0
;
...
...
Firmware/Source/Application/BlueTooth.h
View file @
839e58e9
#ifndef _BLUETOOTH_H
#ifndef _BLUETOOTH_H
#define _BLUETOOTH_H
#define _BLUETOOTH_H
typedef
enum
{
TEXT_NUM_BLUETOOTH_NAME
,
TEXT_NUM_BLUETOOTH_PHONENAME
,
TEXT_NUM_PHONE_NUMBER
,
TEXT_NUM_PHONE_NUMBER_TOTAL
,
TEXT_NUM_INFORMATION_MCUVER
,
TEXT_NUM_INFORMATION_SWVERSION
,
TEXT_NUM_INFORMATION_HW
,
TEXT_NUM_INFORMATION_OS
,
TEXT_NUM_INFORMATION_HMI
,
TEXT_NUM_ROAD_NAME
,
TEXT_NUM_TOTAL
,
}
TEXT_NUM_ENUM
;
typedef
struct
{
TEXT_NUM_ENUM
TextNum
;
uint16_t
LableNum
;
uint16_t
Vaild
;
}
TEXT_STRUCT
;
/*QRCode X Y height Width*/
/*QRCode X Y height Width*/
#define QRCode_X 457
#define QRCode_X 457
#define QRCode_Y 134
#define QRCode_Y 134
...
...
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