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
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
chris007
firmware
Commits
cfa47eb8
Verified
Commit
cfa47eb8
authored
5 years ago
by
genofire
Browse files
Options
Downloads
Patches
Plain Diff
ble: card10 svc - rewrite WIP
parent
8aa8c31f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
epicardium/ble/card10.c
+50
-17
50 additions, 17 deletions
epicardium/ble/card10.c
with
50 additions
and
17 deletions
epicardium/ble/card10.c
+
50
−
17
View file @
cfa47eb8
...
...
@@ -85,7 +85,7 @@ enum {
/* BLE UUID for card10 service*/
static
const
uint8_t
UUID_svc
[]
=
{
CARD10_UUID_SUFFIX
,
0x0
,
CARD10_UUID_PREFIX
};
static
const
uint16_t
UUID_len
=
sizeof
(
UUID_svc
);
// starting at 0x01 with write (non visual) charateristics
...
...
@@ -95,6 +95,7 @@ static const uint8_t UUID_char_time[] = {
UINT16_TO_BYTES
(
CARD10_TIME_UPDATE_VAL_HDL
),
CARD10_UUID_SUFFIX
,
0x01
,
CARD10_UUID_PREFIX
};
static
const
uint16_t
UUID_char_len
=
sizeof
(
UUID_char_time
);
static
const
uint8_t
UUID_attChar_time
[]
=
{
CARD10_UUID_SUFFIX
,
0x01
,
CARD10_UUID_PREFIX
...
...
@@ -239,24 +240,54 @@ static const uint8_t UUID_attChar_light_sensor[] = {
/*
* Create the BLE service description.
*/
static
void
*
addCard10GroupDyn
(
void
)
{
void
*
pSHdl
;
uint8_t
initLightSensorValue
[]
=
{
UINT16_TO_BYTES
(
0
)
};
/* Create the service */
pSHdl
=
AttsDynCreateGroup
(
CARD10_START_HDL
,
CARD10_END_HDL
);
if
(
pSHdl
!=
NULL
)
{
/* Primary service */
AttsDynAddAttrConst
(
pSHdl
,
static
const
attsAttr_t
card10SvcAttrList
[]
=
{
{
attPrimSvcUuid
,
UUID_svc
,
(
uint8_t
*
)
UUID_svc
,
(
uint16_t
*
)
&
UUID_len
,
sizeof
(
UUID_svc
),
0
,
ATTS_PERMIT_READ
);
},
{
attChUuid
,
(
uint8_t
*
)
UUID_char_time
,
(
uint16_t
*
)
&
UUID_char_len
,
sizeof
(
UUID_char_time
),
0
,
ATTS_PERMIT_READ
},
{
attDnChUuid
,
UUID_attChar_time
,
(
uint16_t
*
)
&
UUID_len
,
sizeof
(
UUID_attChar_time
),
0
,
sizeof
(
uint64_t
),
ATTS_SET_WRITE_CBACK
,
(
ATTS_PERMIT_WRITE
|
ATTS_PERMIT_WRITE_ENC
|
ATTS_PERMIT_WRITE_AUTH
)
},
};
static
attsGroup_t
svcCard10Group
=
{
NULL
,
(
attsAttr_t
*
)
card10SvcAttrList
,
NULL
,
NULL
,
CARD10_START_HDL
,
CARD10_END_HDL
,
};
/*
static void *addCard10Group(void)
{
void *pSHdl;
uint8_t initLightSensorValue[] = { UINT16_TO_BYTES(0) };
// TIME UPDTAE
...
...
@@ -274,7 +305,7 @@ static void *addCard10GroupDyn(void)
UUID_attChar_time,
NULL,
0,
sizeof
(
uint64_t
),
Y
sizeof(uint64_t),
ATTS_SET_WRITE_CBACK,
ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH);
...
...
@@ -535,6 +566,7 @@ static void *addCard10GroupDyn(void)
}
return pSHdl;
}
*/
/*
* Set the time given in milliseconds since 1.1.1970 as 64 bit integer.
...
...
@@ -712,6 +744,7 @@ static uint8_t readCard10CB(
void
bleCard10_init
(
void
)
{
void
*
pSHdl
=
addCard10GroupDyn
();
AttsDynRegister
(
pSHdl
,
readCard10CB
,
writeCard10CB
);
AttsAddGroup
(
&
svcCard10Group
);
svcCard10Group
.
readCback
=
readCard10CB
;
svcCard10Group
.
writeCback
=
writeCard10CB
;
}
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