Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
QJ_500-7c
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
时昊
QJ_500-7c
Commits
e604141d
Commit
e604141d
authored
Apr 29, 2024
by
薛小虎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: 添加经典蓝牙中
parent
b04094c8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
45 deletions
+58
-45
app_Ble_User.c
qianjiang/main/app_Ble_User.c
+42
-38
app_Ble_User.h
qianjiang/main/app_Ble_User.h
+2
-1
main_user.c
qianjiang/main/main_user.c
+9
-2
sdkconfig
qianjiang/sdkconfig
+5
-4
No files found.
qianjiang/main/app_Ble_User.c
View file @
e604141d
...
...
@@ -149,14 +149,14 @@ void Get_Ble_Raw_Data(uint8_t *data, uint32_t len)
{
if
(
RecCtrl
.
Sts
==
BleRec_Idle
)
{
printf
(
"receive data:"
);
for
(
uint16_t
i
=
0
;
i
<
len
;
i
++
)
{
printf
(
" %x "
,
data
[
i
]);
}
printf
(
"
\r\n
"
);
//
printf("receive data:");
//
for(uint16_t i = 0; i< len; i++)
//
{
//
printf(" %x ", data[i]);
//
}
//
printf("\r\n");
printf
(
"
\r\n
"
);
//
printf("\r\n");
RecCtrl
.
RecLen
=
0
;
memcpy
((
uint8_t
*
)
&
BleRecData
.
Data
[
RecCtrl
.
RecLen
],
data
,
len
);
...
...
@@ -166,14 +166,14 @@ void Get_Ble_Raw_Data(uint8_t *data, uint32_t len)
{
crc
=
tp_Ble_Crc
(
BleRecData
.
Data
,
RecCtrl
.
TotalLen
-
2
);
printf
(
"receive data:"
);
for
(
uint16_t
i
=
0
;
i
<
RecCtrl
.
TotalLen
;
i
++
)
{
printf
(
" %x "
,
BleRecData
.
Data
[
i
]);
}
printf
(
"
\r\n
"
);
//
printf("receive data:");
//
for(uint16_t i = 0; i< RecCtrl.TotalLen; i++)
//
{
//
printf(" %x ", BleRecData.Data[i]);
//
}
//
printf("\r\n");
printf
(
"rec crc = %d
\r\n
"
,
crc
);
//
printf("rec crc = %d\r\n", crc);
if
((
BleRecData
.
Data
[
RecCtrl
.
TotalLen
-
1
]
!=
0x0A
)
||
(
crc
!=
BleRecData
.
Data
[
RecCtrl
.
TotalLen
-
2
]))
...
...
@@ -192,7 +192,7 @@ void Get_Ble_Raw_Data(uint8_t *data, uint32_t len)
{
RecCtrl
.
Sts
=
BleRec_Start
;
printf
(
"BleRec_Start
\r\n
"
);
//
printf("BleRec_Start \r\n");
}
}
}
...
...
@@ -209,14 +209,14 @@ void Get_Ble_Raw_Data(uint8_t *data, uint32_t len)
{
crc
=
tp_Ble_Crc
(
BleRecData
.
Data
,
RecCtrl
.
TotalLen
-
2
);
printf
(
"receive data:"
);
for
(
uint16_t
i
=
0
;
i
<
RecCtrl
.
TotalLen
;
i
++
)
{
printf
(
" %x "
,
BleRecData
.
Data
[
i
]);
}
printf
(
"
\r\n
"
);
//
printf("receive data:");
//
for(uint16_t i = 0; i< RecCtrl.TotalLen; i++)
//
{
//
printf(" %x ", BleRecData.Data[i]);
//
}
//
printf("\r\n");
printf
(
"rec crc = %d
\r\n
"
,
crc
);
//
printf("rec crc = %d\r\n", crc);
if
((
BleRecData
.
Data
[
RecCtrl
.
TotalLen
-
1
]
!=
0x0A
)
||
(
crc
!=
BleRecData
.
Data
[
RecCtrl
.
TotalLen
-
2
]))
{
...
...
@@ -287,16 +287,16 @@ void Ble_Msg_Authr_RLY(void )
trans_len
=
(
BleTransData
.
Msg
.
Lenth
+
1
)
-
20
*
i
;
}
printf
(
"trans_len = %d
\r\n
"
,
trans_len
);
//
printf("trans_len = %d\r\n", trans_len);
printf
(
"trans data:"
);
for
(
uint16_t
j
=
0
;
j
<
trans_len
;
j
++
)
{
printf
(
" %x "
,
BleTransData
.
Data
[
j
+
i
*
20
]);
}
printf
(
"
\r\n
"
);
//
printf("trans data:");
//
for(uint16_t j = 0; j< trans_len; j++)
//
{
//
printf(" %x ", BleTransData.Data[j + i*20]);
//
}
//
printf("\r\n");
printf
(
"
\r\n
"
);
//
printf("\r\n");
err
=
bsp_Ble_Gatts_Send_Indicate
(
trans_len
,
&
BleTransData
.
Data
[
i
*
20
]);
...
...
@@ -355,16 +355,16 @@ void Ble_Msg_RequestNavi_RLY(void )
trans_len
=
(
BleTransData
.
Msg
.
Lenth
+
1
)
-
20
*
i
;
}
printf
(
"trans_len = %d
\r\n
"
,
trans_len
);
//
printf("trans_len = %d\r\n", trans_len);
printf
(
"trans data:"
);
for
(
uint16_t
j
=
0
;
j
<
trans_len
;
j
++
)
{
printf
(
" %x "
,
BleTransData
.
Data
[
j
+
i
*
20
]);
}
printf
(
"
\r\n
"
);
//
printf("trans data:");
//
for(uint16_t j = 0; j< trans_len; j++)
//
{
//
printf(" %x ", BleTransData.Data[j + i*20]);
//
}
//
printf("\r\n");
printf
(
"
\r\n
"
);
//
printf("\r\n");
bsp_Ble_Gatts_Send_Indicate
(
trans_len
,
&
BleTransData
.
Data
[
i
*
20
]);
...
...
@@ -388,6 +388,10 @@ void Ble_MsgRec_Navi_Analysis(void )
Ble_Navi_Data
.
Navi_Dte
[
2
]
=
BleRecData
.
Msg
.
Param
[
4
];
Ble_Navi_Data
.
Navi_Dte
[
3
]
=
BleRecData
.
Msg
.
Param
[
5
];
printf
(
"Navi sts %d Navi_Turn %x Navi_Dte0 %x Navi_Dte1 %x Navi_Dte2 %x Navi_Dte3 %x
\r\n
"
,
\
Ble_Navi_Data
.
Navi_Sts
,
Ble_Navi_Data
.
Navi_Turn
,
Ble_Navi_Data
.
Navi_Dte
[
0
],
Ble_Navi_Data
.
Navi_Dte
[
1
],
Ble_Navi_Data
.
Navi_Dte
[
2
],
Ble_Navi_Data
.
Navi_Dte
[
3
]);
Ble_Sts_Ctrl
.
Navi_Updat
=
1
;
}
...
...
qianjiang/main/app_Ble_User.h
View file @
e604141d
...
...
@@ -59,7 +59,7 @@ typedef struct
}
app_Ble_Rec_Data_Ctrl_Struct
;
extern
app_Ble_Rec_Data_Ctrl_Struct
RecCtrl
;
extern
Ble_User_Control_Struct
Ble_Sts_Ctrl
;
extern
Ble_Navi_Info_Struct
Ble_Navi_Data
;
extern
uint8_t
Wifi_OTA_Request
;
...
...
@@ -220,5 +220,6 @@ void Ble_Rec_Msg_Analysis_Process(void );
void
Ble_Connect_Event_Pro
(
void
);
void
Ble_DisConnect_Event_Pro
(
void
);
void
Ble_User_Init
(
void
);
void
Ble_Msg_RequestNavi_RLY
(
void
);
#endif
\ No newline at end of file
qianjiang/main/main_user.c
View file @
e604141d
...
...
@@ -71,13 +71,20 @@ static void Sys_Run_Tasks(void *arg)
if
(
SYS_RUN_TASK_1000MS
)
{
testcnt
++
;
if
(
testcnt
>=
2
)
if
(
testcnt
>=
5
)
{
testcnt
=
0
;
// printf("Ble_Sts_Ctrl.Ble_Sts = %d\r\n", Ble_Sts_Ctrl.Ble_Sts);
// printf("Ble_Sts_Ctrl.Navi_Updat = %d\r\n", Ble_Sts_Ctrl.Navi_Updat);
// // printf("Ble_Sts_Ctrl.Navi_Updat = %d\r\n", Ble_Sts_Ctrl.Navi_Updat);
// printf("RecCtrl.Sts = %d\r\n", RecCtrl.Sts);
// Ble_Msg_RequestNavi_RLY();
}
simple_ota_service
();
...
...
qianjiang/sdkconfig
View file @
e604141d
...
...
@@ -1313,15 +1313,16 @@ CONFIG_HEAP_TRACING_OFF=y
#
# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set
# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
CONFIG_LOG_DEFAULT_LEVEL_WARN=y
# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set
# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set
# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
CONFIG_LOG_DEFAULT_LEVEL=
3
CONFIG_LOG_DEFAULT_LEVEL=
2
CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
# CONFIG_LOG_MAXIMUM_LEVEL_INFO is not set
# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set
# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set
CONFIG_LOG_MAXIMUM_LEVEL=
3
CONFIG_LOG_MAXIMUM_LEVEL=
2
CONFIG_LOG_COLORS=y
CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y
# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set
...
...
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