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
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
card10
firmware
Commits
92227700
Commit
92227700
authored
Jan 24, 2021
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
feat(mp-ble): Allow to set/get device name
parent
0a8142ab
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
epicardium/ble/epic_ble_api.c
+12
-0
12 additions, 0 deletions
epicardium/ble/epic_ble_api.c
epicardium/epicardium.h
+4
-0
4 additions, 0 deletions
epicardium/epicardium.h
pycardium/modules/modbluetooth_card10.c
+4
-4
4 additions, 4 deletions
pycardium/modules/modbluetooth_card10.c
with
20 additions
and
4 deletions
epicardium/ble/epic_ble_api.c
+
12
−
0
View file @
92227700
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
#include
"api/interrupt-sender.h"
#include
"api/interrupt-sender.h"
#include
"wsf_buf.h"
#include
"wsf_buf.h"
#include
"svc_core.h"
#include
"FreeRTOS.h"
#include
"FreeRTOS.h"
#include
"queue.h"
#include
"queue.h"
...
@@ -90,3 +91,14 @@ void ble_epic_dm_api_event(dmEvt_t *dm_event)
...
@@ -90,3 +91,14 @@ void ble_epic_dm_api_event(dmEvt_t *dm_event)
LOG_WARN
(
"ble"
,
"could not allocate dm event"
);
LOG_WARN
(
"ble"
,
"could not allocate dm event"
);
}
}
}
}
int
epic_ble_set_device_name
(
const
uint8_t
*
buf
,
uint16_t
len
)
{
return
epic_ble_atts_set_attr
(
GAP_DN_HDL
,
buf
,
len
);
}
int
epic_ble_get_device_name
(
uint8_t
**
buf
,
uint16_t
*
len
)
{
uint8_t
ret
=
AttsGetAttr
(
GAP_DN_HDL
,
len
,
buf
);
return
ret
;
}
This diff is collapsed.
Click to expand it.
epicardium/epicardium.h
+
4
−
0
View file @
92227700
...
@@ -177,6 +177,8 @@ typedef _Bool bool;
...
@@ -177,6 +177,8 @@ typedef _Bool bool;
#define API_BLE_GET_ATT_WRITE 0x1BD
#define API_BLE_GET_ATT_WRITE 0x1BD
#define API_BLE_FREE_ATT_WRITE 0x1BE
#define API_BLE_FREE_ATT_WRITE 0x1BE
#define API_BLE_ATTS_DYN_ADD_CHARACTERISTIC 0x1BF
#define API_BLE_ATTS_DYN_ADD_CHARACTERISTIC 0x1BF
#define API_BLE_SET_DEVICE_NAME 0x172
#define API_BLE_GET_DEVICE_NAME 0x173
#define API_BLE_GET_ADDRESS 0x174
#define API_BLE_GET_ADDRESS 0x174
/* clang-format on */
/* clang-format on */
...
@@ -2606,6 +2608,8 @@ API(API_BLE_ATTS_SET_BUFFER, int epic_ble_atts_set_buffer(uint16_t value_handle,
...
@@ -2606,6 +2608,8 @@ API(API_BLE_ATTS_SET_BUFFER, int epic_ble_atts_set_buffer(uint16_t value_handle,
API
(
API_BLE_FREE_EVENT
,
int
epic_ble_free_event
(
struct
epic_ble_event
*
e
));
API
(
API_BLE_FREE_EVENT
,
int
epic_ble_free_event
(
struct
epic_ble_event
*
e
));
API
(
API_BLE_SET_DEVICE_NAME
,
int
epic_ble_set_device_name
(
const
uint8_t
*
buf
,
uint16_t
len
));
API
(
API_BLE_GET_DEVICE_NAME
,
int
epic_ble_get_device_name
(
uint8_t
**
buf
,
uint16_t
*
len
));
API
(
API_BLE_GET_ADDRESS
,
void
epic_ble_get_address
(
uint8_t
*
addr
));
API
(
API_BLE_GET_ADDRESS
,
void
epic_ble_get_address
(
uint8_t
*
addr
));
#endif
/* _EPICARDIUM_H */
#endif
/* _EPICARDIUM_H */
...
...
This diff is collapsed.
Click to expand it.
pycardium/modules/modbluetooth_card10.c
+
4
−
4
View file @
92227700
...
@@ -332,14 +332,14 @@ void mp_bluetooth_get_device_addr(uint8_t *addr)
...
@@ -332,14 +332,14 @@ void mp_bluetooth_get_device_addr(uint8_t *addr)
size_t
mp_bluetooth_gap_get_device_name
(
const
uint8_t
**
buf
)
size_t
mp_bluetooth_gap_get_device_name
(
const
uint8_t
**
buf
)
{
{
raise
();
uint16_t
len
;
return
0
;
epic_ble_get_device_name
((
uint8_t
**
)
buf
,
&
len
);
return
len
;
}
}
int
mp_bluetooth_gap_set_device_name
(
const
uint8_t
*
buf
,
size_t
len
)
int
mp_bluetooth_gap_set_device_name
(
const
uint8_t
*
buf
,
size_t
len
)
{
{
raise
();
return
epic_ble_set_device_name
(
buf
,
len
);
return
0
;
}
}
// Start advertisement. Will re-start advertisement when already enabled.
// Start advertisement. Will re-start advertisement when already enabled.
...
...
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