Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fpletz
firmware
Commits
bd325f08
Verified
Commit
bd325f08
authored
5 years ago
by
schneider
Committed by
rahix
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
chore(ble): Clean up uart file
parent
6348e507
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
epicardium/ble/ble.c
+1
-0
1 addition, 0 deletions
epicardium/ble/ble.c
epicardium/ble/uart.c
+8
-17
8 additions, 17 deletions
epicardium/ble/uart.c
epicardium/modules/modules.h
+1
-0
1 addition, 0 deletions
epicardium/modules/modules.h
with
10 additions
and
17 deletions
epicardium/ble/ble.c
+
1
−
0
View file @
bd325f08
...
...
@@ -47,6 +47,7 @@ static wsfBufPoolDesc_t mainPoolDesc[WSF_BUF_POOLS] =
/*! \brief Stack initialization for app. */
extern
void
StackInit
(
void
);
extern
void
AppInit
(
void
);
extern
void
bleuart_init
(
void
);
/*************************************************************************************************/
void
PalSysAssertTrap
(
void
)
...
...
This diff is collapsed.
Click to expand it.
epicardium/ble/uart.c
+
8
−
17
View file @
bd325f08
#include
"modules/modules.h"
#include
"wsf_types.h"
#include
"wsf_os.h"
#include
"wsf_buf.h"
#include
"wsf_timer.h"
#include
"wsf_trace.h"
#include
"app_ui.h"
#include
"ble_api.h"
#include
"hci_vs.h"
#include
"att_defs.h"
#include
"util/bstream.h"
#include
"att_api.h"
#include
"modules/modules.h"
#include
"FreeRTOS.h"
#include
"timers.h"
...
...
@@ -21,7 +13,7 @@
#define UART_START_HDL 0x800
/*!< \brief Service start handle. */
#define UART_END_HDL (
BAT
T_MAX_HDL - 1)
/*!< \brief Service end handle. */
#define UART_END_HDL (
UAR
T_MAX_HDL - 1)
/*!< \brief Service end handle. */
/**************************************************************************************************
Handles
...
...
@@ -30,16 +22,17 @@
/*! \brief UART Service Handles */
enum
{
UART_SVC_HDL
=
UART_START_HDL
,
/*!< \brief UART service declaration */
UART_SVC_HDL
=
UART_START_HDL
,
/*!< \brief UART service declaration */
UART_RX_CH_HDL
,
/*!< \brief UART rx characteristic */
UART_RX_HDL
,
/*!< \brief UART rx value */
UART_TX_CH_HDL
,
/*!< \brief UART tx characteristic */
UART_TX_HDL
,
/*!< \brief UART tx value */
UART_TX_CH_CCC_HDL
,
/*!< \brief UART tx CCCD */
BAT
T_MAX_HDL
/*!< \brief Maximum handle. */
UAR
T_MAX_HDL
/*!< \brief Maximum handle. */
};
/**@}*/
/* clang-format off */
static
const
uint8_t
UARTSvc
[]
=
{
0x9E
,
0xCA
,
0xDC
,
0x24
,
0x0E
,
0xE5
,
0xA9
,
0xE0
,
0x93
,
0xF3
,
0xA3
,
0xB5
,
0x01
,
0x00
,
0x40
,
0x6E
};
static
const
uint8_t
uartRxCh
[]
=
{
ATT_PROP_WRITE
,
UINT16_TO_BYTES
(
UART_RX_HDL
),
0x9E
,
0xCA
,
0xDC
,
0x24
,
0x0E
,
0xE5
,
0xA9
,
0xE0
,
0x93
,
0xF3
,
0xA3
,
0xB5
,
0x02
,
0x00
,
0x40
,
0x6E
};
...
...
@@ -47,7 +40,7 @@ const uint8_t attUartRxChUuid[] = {0x9E,0xCA,0xDC,0x24,0x0E,0xE5, 0xA9,0xE0,0x93
static
const
uint8_t
uartTxCh
[]
=
{
ATT_PROP_READ
|
ATT_PROP_NOTIFY
,
UINT16_TO_BYTES
(
UART_TX_HDL
),
0x9E
,
0xCA
,
0xDC
,
0x24
,
0x0E
,
0xE5
,
0xA9
,
0xE0
,
0x93
,
0xF3
,
0xA3
,
0xB5
,
0x03
,
0x00
,
0x40
,
0x6E
};
const
uint8_t
attUartTxChUuid
[]
=
{
0x9E
,
0xCA
,
0xDC
,
0x24
,
0x0E
,
0xE5
,
0xA9
,
0xE0
,
0x93
,
0xF3
,
0xA3
,
0xB5
,
0x03
,
0x00
,
0x40
,
0x6E
};
/*
Battery level client characteristic configur
at
i
on */
/*
clang-form
at
on */
...
...
@@ -55,7 +48,6 @@ static void *SvcUARTAddGroupDyn(void)
{
void
*
pSHdl
;
uint8_t
initCcc
[]
=
{
UINT16_TO_BYTES
(
0x0000
)};
uint8_t
initUARTVal
[]
=
{
0x20
};
/* Create the service */
pSHdl
=
AttsDynCreateGroup
(
UART_START_HDL
,
UART_END_HDL
);
...
...
@@ -79,7 +71,7 @@ static void *SvcUARTAddGroupDyn(void)
AttsDynAddAttrConst
(
pSHdl
,
attChUuid
,
uartTxCh
,
sizeof
(
uartTxCh
),
0
,
ATTS_PERMIT_READ
);
/* UART tx value */
/* TODO: do we need ATTS_SET_READ_CBACK ? */
AttsDynAddAttr
(
pSHdl
,
attUartTxChUuid
,
initUARTVal
,
sizeof
(
uint8_t
)
,
sizeof
(
uint8_t
),
AttsDynAddAttr
(
pSHdl
,
attUartTxChUuid
,
NULL
,
0
,
sizeof
(
uint8_t
),
ATTS_SET_READ_CBACK
,
ATTS_PERMIT_READ
);
/* UART tx CCC descriptor */
AttsDynAddAttr
(
pSHdl
,
attCliChCfgUuid
,
initCcc
,
sizeof
(
uint16_t
),
sizeof
(
uint16_t
),
...
...
@@ -94,7 +86,6 @@ dmConnId_t active_connection = 0;
static
uint8_t
UARTReadCback
(
dmConnId_t
connId
,
uint16_t
handle
,
uint8_t
operation
,
uint16_t
offset
,
attsAttr_t
*
pAttr
)
{
//AppHwBattRead(pAttr->pValue);
printf
(
"read callback
\n
"
);
return
ATT_SUCCESS
;
}
...
...
This diff is collapsed.
Click to expand it.
epicardium/modules/modules.h
+
1
−
0
View file @
bd325f08
#ifndef MODULES_H
#define MODULES_H
#include
<stdint.h>
/* ---------- FAT fs ------------------------------------------------------ */
/* Number of bits to use for indexing into our internal pool of files/directories
* This indirectly specifies the size of the pool as 2^EPIC_FAT_FD_INDEX_BITS
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment